Skip to content

Instantly share code, notes, and snippets.

@shotasenga
Created February 27, 2018 10:01
Show Gist options
  • Save shotasenga/b027ec0c3ef8fec5f3f225a1c0d06984 to your computer and use it in GitHub Desktop.
Save shotasenga/b027ec0c3ef8fec5f3f225a1c0d06984 to your computer and use it in GitHub Desktop.
GM Script to remove target="_blank" attribute on Amazon
// ==UserScript==
// @name no more BLANK on Amazon
// @namespace http://senta.me/
// @version 0.1.0
// @description Remove target="_blank" on Amazon
// @author @__senta
// @match https?://amazon.co.jp/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
Array.prototype.slice.call(document.querySelectorAll('[target="_blank"][href^="/"]'))
.forEach(el => el.removeAttribute('target'))
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment