Fix: move origin check to background
This commit is contained in:
parent
a976c45a3a
commit
c11804b109
|
@ -28,7 +28,11 @@ window.API_METHODS = Object.assign(window.API_METHODS || {}, {
|
|||
removeExclusion: styleManager.removeExclusion,
|
||||
|
||||
getTabUrlPrefix() {
|
||||
return this.sender.tab.url.match(/^([\w-]+:\/+[^/#]+)/)[1];
|
||||
const {url} = this.sender.tab;
|
||||
if (url.startsWith(URLS.ownOrigin)) {
|
||||
return 'stylus';
|
||||
}
|
||||
return url.match(/^([\w-]+:\/+[^/#]+)/)[1];
|
||||
},
|
||||
|
||||
download(msg) {
|
||||
|
|
|
@ -270,9 +270,6 @@ const APPLY = (() => {
|
|||
}
|
||||
|
||||
function fetchParentDomain() {
|
||||
if (/-extension/.test(location.protocol)) {
|
||||
parentDomain = 'stylus';
|
||||
}
|
||||
if (parentDomain) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user