Simplify isBrowserExtension() implementation

parent 51fb81e2
......@@ -111,13 +111,7 @@ function configFuncSettingsFrom(window_) {
*
*/
function isBrowserExtension(config) {
if (config.app.indexOf('chrome-extension://') === 0 ||
config.app.indexOf('moz-extension://') === 0 ||
config.app.indexOf('ms-browser-extension://') === 0) {
return true;
}
return false;
return !(config.app.startsWith('http://') || config.app.startsWith('https://'));
}
module.exports = {
......
......@@ -259,9 +259,10 @@ describe('annotation.config.settings', function() {
url: 'https://partner.org',
returns: false,
},
// It considers anything not http(s) to be a browser extension.
{
url: 'ftp://partner.org',
returns: false,
returns: true,
},
].forEach(function(test) {
it('returns ' + test.returns + ' for ' + test.url, function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment