custom-openstreetmap-tile-s.../js/background.js

17 lines
495 B
JavaScript

const urls = [
"*://*.tile.openstreetmap.org/*"
]
function log(msg) {
console.log("custom-openstreetmap-tile-server: " + msg)
}
function replaceTileserver(request) {
var url = request.url.replace("tile.openstreetmap.org", "tiles.demostat.de");
console.log("custom-openstreetmap-tile-server: " + request.url + " -> " + url);
log(request.url + " -> " + url);
return {redirectUrl: url};
}
chrome.webRequest.onBeforeRequest.addListener(replaceTileserver, {urls: urls}, ["blocking"]);