'How to use redirect transform when coding a chrome extension
I am trying to make an extension that redirects all reddit links to old reddit version but when I try it nothing happens (the link just gets opened in the new reddit domain not the .old one)
my manifest.json:
"name": "OldREddit",
"action": {
"default_icon": "icon.png"
},
"icons": {
"16": "icon.png",
"48": "icon.png",
"128": "icon.png" },
"manifest_version": 3,
"version": "0.1",
"description": "Do not like the new reddit UI? This extension turns all new reddit links to old.reddit domain",
"declarative_net_request" : {
"rule_resources" : [{
"id": "ruleset",
"enabled": true,
"path": "rules_1.json"
}]
},
"permissions": [
"declarativeNetRequest"
],
"host_permissions": [
"*://old.reddit.com/*",
"*://reddit.com/*"
]
}
and here is my rules_1.json:
"id": 1,
"priority": 1,
"action": {
"type": "redirect",
"redirect": {
"transform": { "scheme": "https", "host": "old.reddit.com" }
}
},
"condition": { "urlFilter": "||reddit.com", "resourceTypes": ["main_frame"] }
}]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
