mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 23:37:33 +09:00
Fix WebExtension startup and URI matching compatibility
This commit is contained in:
parent
1b90447aa4
commit
dbc2b42c7f
2 changed files with 16 additions and 3 deletions
|
|
@ -406,7 +406,7 @@ BrowserGlue.prototype = {
|
||||||
os.addObserver(this, "flash-plugin-hang", false);
|
os.addObserver(this, "flash-plugin-hang", false);
|
||||||
os.addObserver(this, "xpi-signature-changed", false);
|
os.addObserver(this, "xpi-signature-changed", false);
|
||||||
os.addObserver(this, "autocomplete-did-enter-text", false);
|
os.addObserver(this, "autocomplete-did-enter-text", false);
|
||||||
Services.prefs.addObserver(PREF_INTERNAL_USERSCRIPTS_ENABLED, this);
|
Services.prefs.addObserver(PREF_INTERNAL_USERSCRIPTS_ENABLED, this, false);
|
||||||
|
|
||||||
if (AppConstants.NIGHTLY_BUILD) {
|
if (AppConstants.NIGHTLY_BUILD) {
|
||||||
os.addObserver(this, AddonWatcher.TOPIC_SLOW_ADDON_DETECTED, false);
|
os.addObserver(this, AddonWatcher.TOPIC_SLOW_ADDON_DETECTED, false);
|
||||||
|
|
|
||||||
|
|
@ -89,9 +89,22 @@ SingleMatchPattern.prototype = {
|
||||||
let suffix = host.substr(2);
|
let suffix = host.substr(2);
|
||||||
let dotSuffix = "." + suffix;
|
let dotSuffix = "." + suffix;
|
||||||
|
|
||||||
return ({host}) => host === suffix || host.endsWith(dotSuffix);
|
return uri => {
|
||||||
|
try {
|
||||||
|
let host = uri.host;
|
||||||
|
return host === suffix || host.endsWith(dotSuffix);
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return uri => uri.host === host;
|
return uri => {
|
||||||
|
try {
|
||||||
|
return uri.host === host;
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
matches(uri, ignorePath = false) {
|
matches(uri, ignorePath = false) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue