17 lines
349 B
JavaScript
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;
|
|
}
|
|
});
|
|
})();
|