Initial commit
This commit is contained in:
16
content_scripts/base-url-switcher.js
Normal file
16
content_scripts/base-url-switcher.js
Normal file
@@ -0,0 +1,16 @@
|
||||
(function () {
|
||||
if (window.hasRun) {
|
||||
return;
|
||||
}
|
||||
window.hasRun = true;
|
||||
|
||||
browser.runtime.onMessage.addListener((message) => {
|
||||
if (message.command === "switch_base_url") {
|
||||
window.location =
|
||||
message.baseUrl +
|
||||
window.location.pathname +
|
||||
window.location.search +
|
||||
window.location.hash;
|
||||
}
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user