Skip to content

Commit 41cb3e2

Browse files
committed
Add support for protocol chrome-extension:
1 parent ddc62f1 commit 41cb3e2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ module.exports = function loadScript (options, callback) {
77
// Allow for the simplest case, just passing a `src` string.
88
if (type(options) === 'string') options = { src : options };
99

10-
var https = document.location.protocol === 'https:';
10+
var https = document.location.protocol === 'https:' ||
11+
document.location.protocol === 'chrome-extension:';
1112

1213
// If you use protocol relative URLs, third-party scripts like Google
1314
// Analytics break when testing with `file:` so this fixes that.
@@ -45,4 +46,4 @@ module.exports = function loadScript (options, callback) {
4546
// Return the script element in case they want to do anything special, like
4647
// give it an ID or attributes.
4748
return script;
48-
};
49+
};

0 commit comments

Comments
 (0)