Skip to content

Instantly share code, notes, and snippets.

@watagashi
Created May 3, 2021 14:26
Show Gist options
  • Select an option

  • Save watagashi/ebd3bddd73628a46f847545bbf2d3ade to your computer and use it in GitHub Desktop.

Select an option

Save watagashi/ebd3bddd73628a46f847545bbf2d3ade to your computer and use it in GitHub Desktop.
// vim:ts=2:sw=2:et
if (window.URL) {
registerPlugin({
newMessageElement: function (elem) {
var keys = [
'fbclid',
'utm_source',
'utm_medium',
'utm_campaign',
'utm_term',
'utm_content',
];
Array.prototype.forEach.call(
elem.querySelectorAll('.status a.link'),
function (a) {
var url = new URL(a.href);
keys.forEach(function (key) {
url.searchParams.delete(key);
});
a.href = url.toString();
}
);
},
});
}
@watagashi
Copy link
Author

watagashi commented May 3, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment