Fix: minor
This commit is contained in:
parent
fd5eeb4b81
commit
c1bf9f57e9
|
@ -15,7 +15,7 @@ window.API_METHODS = Object.assign(window.API_METHODS || {}, {
|
|||
editSave: styleManager.editSave,
|
||||
|
||||
getTabUrlPrefix() {
|
||||
return this.sender.tab.url.match(/^([\w-]+:\/\/[^/#]+)/)[1];
|
||||
return this.sender.tab.url.match(/^([\w-]+:\/+[^/#]+)/)[1];
|
||||
},
|
||||
|
||||
getStyleFromDB: id =>
|
||||
|
@ -254,12 +254,12 @@ if (chrome.contextMenus) {
|
|||
createContextMenus(keys);
|
||||
}
|
||||
|
||||
// reinject content scripts when the extension is reloaded/updated. Firefox
|
||||
// would handle this automatically.
|
||||
if (!FIREFOX) {
|
||||
reinjectContentScripts();
|
||||
}
|
||||
|
||||
// FIXME: implement exposeIframes in apply.js
|
||||
|
||||
// register hotkeys
|
||||
if (FIREFOX && browser.commands && browser.commands.update) {
|
||||
const hotkeyPrefs = Object.keys(prefs.defaults).filter(k => k.startsWith('hotkey.'));
|
||||
|
@ -305,7 +305,6 @@ function reinjectContentScripts() {
|
|||
cs.matches.some(match => {
|
||||
if ((match === ALL_URLS || url.match(match)) &&
|
||||
(!url.startsWith('chrome') || url === NTP)) {
|
||||
// TODO: add a `msg.pingTab` API?
|
||||
msg.sendTab(id, {method: 'ping'})
|
||||
.catch(() => false)
|
||||
.then(pong => !pong && injectCS(cs, id));
|
||||
|
|
|
@ -463,7 +463,7 @@ const styleManager = (() => {
|
|||
}
|
||||
|
||||
function getDomain(url) {
|
||||
return url.match(/^[\w-]+:\/\/(?:[\w:-]+@)?([^:/#]+)/)[1];
|
||||
return url.match(/^[\w-]+:\/+(?:[\w:-]+@)?([^:/#]+)/)[1];
|
||||
}
|
||||
|
||||
function getUrlNoHash(url) {
|
||||
|
|
|
@ -163,7 +163,7 @@
|
|||
});
|
||||
}
|
||||
|
||||
function install({url, direct, downloaded, tab}, sender) {
|
||||
function install({url, direct, downloaded, tab}, sender = this.sender) {
|
||||
tab = tab !== undefined ? tab : sender.tab;
|
||||
url = url || tab.url;
|
||||
if (direct && !downloaded) {
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
<link href="global.css" rel="stylesheet">
|
||||
<link href="install-usercss/install-usercss.css" rel="stylesheet">
|
||||
|
||||
<script src="js/promisify.js"></script>
|
||||
<script src="js/msg.js"></script>
|
||||
<script src="js/messaging.js"></script>
|
||||
<script src="js/prefs.js"></script>
|
||||
<script src="js/dom.js"></script>
|
||||
|
|
|
@ -68,13 +68,13 @@
|
|||
"matches": ["http://userstyles.org/*", "https://userstyles.org/*"],
|
||||
"run_at": "document_start",
|
||||
"all_frames": true,
|
||||
"js": ["js/promisify.js", "js/msg.js", "content/install-hook-userstyles.js"]
|
||||
"js": ["content/install-hook-userstyles.js"]
|
||||
},
|
||||
{
|
||||
"matches": ["https://openusercss.org/*", "https://openusercss.com/*"],
|
||||
"run_at": "document_start",
|
||||
"all_frames": false,
|
||||
"js": ["js/promisify.js", "js/msg.js", "content/install-hook-openusercss.js"]
|
||||
"js": ["content/install-hook-openusercss.js"]
|
||||
},
|
||||
{
|
||||
"matches": [
|
||||
|
@ -98,7 +98,7 @@
|
|||
],
|
||||
"run_at": "document_idle",
|
||||
"all_frames": false,
|
||||
"js": ["js/promisify.js", "js/msg.js", "content/install-hook-usercss.js"]
|
||||
"js": ["content/install-hook-usercss.js"]
|
||||
}
|
||||
],
|
||||
"browser_action": {
|
||||
|
|
Loading…
Reference in New Issue
Block a user