-
-
Save neetsdkasu/62d1497c1faa4111f2ede04abf7eef4c to your computer and use it in GitHub Desktop.
WebExtension: remove name param for twimg (on browser vivaldi)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"manifest_version": 2, | |
"name": " remove name param for twimg", | |
"version": "1.0", | |
"author": "Leonardone", | |
"description": " remove name param for twimg", | |
"icons" : { | |
"48": "icon.png" | |
}, | |
"content_scripts": [ | |
{ | |
"matches": ["*://pbs.twimg.com/*"], | |
"js": ["script.js"], | |
"run_at": "document_start" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// script.js | |
// Browser WebExtention | |
// remove name param for twimg | |
// author: Leonardone | |
let loc = window.location; | |
if (loc.search.length > 1) { | |
let params = new URLSearchParams(loc.search.substring(1)); | |
if (params.has("name")) { | |
params.delete("name"); | |
window.location.search = params.toString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment