Skip to content

Instantly share code, notes, and snippets.

@neetsdkasu
Last active September 11, 2020 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neetsdkasu/62d1497c1faa4111f2ede04abf7eef4c to your computer and use it in GitHub Desktop.
Save neetsdkasu/62d1497c1faa4111f2ede04abf7eef4c to your computer and use it in GitHub Desktop.
WebExtension: remove name param for twimg (on browser vivaldi)
{
"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"
}
]
}
// 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