Files
base-url-switcher-browser-e…/content_scripts/base-url-switcher.js
2021-07-13 23:11:58 +02:00

17 lines
349 B
JavaScript

(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;
}
});
})();