diff --git a/manifest.json b/manifest.json index fc04348..ee5e1e9 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,9 @@ "128": "icons/icon128.png" }, "permissions": [ - "https://www.strava.com/*" + "declarativeNetRequestWithHostAccess", + "https://www.strava.com/*", + "https://mapserver.mapy.cz/*" ], "content_scripts": [ { @@ -20,6 +22,15 @@ ] } ], + "declarative_net_request": { + "rule_resources": [ + { + "id": "mapy_cz", + "enabled": true, + "path": "rules_mapy_cz.json" + } + ] + }, "web_accessible_resources": [ "3rd/Leaflet.GoogleMutant.js", "3rd/jquery-3.5.1.min.js", diff --git a/rules_mapy_cz.json b/rules_mapy_cz.json new file mode 100644 index 0000000..67756dc --- /dev/null +++ b/rules_mapy_cz.json @@ -0,0 +1,24 @@ +[ + { + "id": 1, + "priority": 1, + "action": { + "type": "modifyHeaders", + "requestHeaders": [ + { + "header": "referer", + "operation": "set", + "value": "https://mapy.cz/" + }, + { + "header": "origin", + "operation": "remove" + } + ] + }, + "condition": { + "initiatorDomains": ["www.strava.com"], + "urlFilter": "||mapserver.mapy.cz/*/*-*-*" + } + } +]