Restrict cosmetic filter creation to the origin of the page it's on
This commit is contained in:
+3
-2
@@ -63,8 +63,9 @@ chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
|
||||
break
|
||||
}
|
||||
case 'cosmeticFilterCreate': {
|
||||
const { host, selector } = msg
|
||||
applyCosmeticFilter(host, selector)
|
||||
if (sender.origin) {
|
||||
applyCosmeticFilter(new URL(sender.origin).host, msg.selector)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,7 +413,6 @@ chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
|
||||
// Append the hostname and forward to the background script
|
||||
chrome.runtime.sendMessage({
|
||||
type: 'cosmeticFilterCreate',
|
||||
host: window.location.host,
|
||||
selector: msg.selector
|
||||
})
|
||||
quitElementPicker()
|
||||
|
||||
Reference in New Issue
Block a user