-
-
Save neoOpus/f63708668b6795f3fa362faeedb893ab to your computer and use it in GitHub Desktop.
Tampermonkey UserScript - Automatic Tab Closer Based on Designated URL Text
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
// ==UserScript== | |
// @name Autoclose URL | |
// @namespace Autoclose URL | |
// @include * | |
// @grant window.close | |
// ==/UserScript== | |
function check_if_should_close(url) { | |
if (url.match(/rnoreward/)) | |
return true; | |
return false; | |
} | |
if (check_if_should_close(document.location.href)) { | |
var win = window.open('your current page URL', '_self', ''); | |
window.close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment