Moved registration removal to a util function.

This commit is contained in:
Ajay Ramachandran
2020-01-09 22:32:20 -05:00
parent 1f4c4c0901
commit a5adf73b88
3 changed files with 30 additions and 29 deletions

View File

@@ -192,18 +192,7 @@ function invidiousOnClick(checkbox, option) {
}
});
} else {
if (isFirefox()) {
chrome.runtime.sendMessage({
message: "unregisterContentScript",
id: "invidious"
});
} else {
chrome.declarativeContent.onPageChanged.removeRules(["invidious"]);
}
chrome.permissions.remove({
origins: getInvidiousInstancesRegex()
});
removeExtraSiteRegistration();
}
}