Restrict cosmetic filter creation to the origin of the page it's on

This commit is contained in:
Anton Lazarev
2023-02-09 16:52:00 -08:00
parent d7ccef9414
commit 33549eaa08
2 changed files with 3 additions and 3 deletions
@@ -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()