Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
569f8983
Unverified
Commit
569f8983
authored
Jun 08, 2017
by
Sean Hammond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify isBrowserExtension() implementation
parent
51fb81e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
8 deletions
+3
-8
settings.js
src/annotator/config/settings.js
+1
-7
settings-test.js
src/annotator/config/test/settings-test.js
+2
-1
No files found.
src/annotator/config/settings.js
View file @
569f8983
...
@@ -111,13 +111,7 @@ function configFuncSettingsFrom(window_) {
...
@@ -111,13 +111,7 @@ function configFuncSettingsFrom(window_) {
*
*
*/
*/
function
isBrowserExtension
(
config
)
{
function
isBrowserExtension
(
config
)
{
if
(
config
.
app
.
indexOf
(
'chrome-extension://'
)
===
0
||
return
!
(
config
.
app
.
startsWith
(
'http://'
)
||
config
.
app
.
startsWith
(
'https://'
));
config
.
app
.
indexOf
(
'moz-extension://'
)
===
0
||
config
.
app
.
indexOf
(
'ms-browser-extension://'
)
===
0
)
{
return
true
;
}
return
false
;
}
}
module
.
exports
=
{
module
.
exports
=
{
...
...
src/annotator/config/test/settings-test.js
View file @
569f8983
...
@@ -259,9 +259,10 @@ describe('annotation.config.settings', function() {
...
@@ -259,9 +259,10 @@ describe('annotation.config.settings', function() {
url
:
'https://partner.org'
,
url
:
'https://partner.org'
,
returns
:
false
,
returns
:
false
,
},
},
// It considers anything not http(s) to be a browser extension.
{
{
url
:
'ftp://partner.org'
,
url
:
'ftp://partner.org'
,
returns
:
fals
e
,
returns
:
tru
e
,
},
},
].
forEach
(
function
(
test
)
{
].
forEach
(
function
(
test
)
{
it
(
'returns '
+
test
.
returns
+
' for '
+
test
.
url
,
function
()
{
it
(
'returns '
+
test
.
returns
+
' for '
+
test
.
url
,
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment