add: "script.js"
This commit is contained in:
commit
ea3713da2f
1 changed files with 22 additions and 0 deletions
22
script.js
Normal file
22
script.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// ==UserScript==
|
||||
// @name Open Reddit posts in new tab
|
||||
// @namespace https://vlw.se/
|
||||
// @version 1.1.0
|
||||
// @description A script that opens Reddit posts in a new tab without the need to be logged in
|
||||
// @author Victor Westerlund
|
||||
// @match https://www.reddit.com/*
|
||||
// @icon https://www.redditstatic.com/shreddit/assets/favicon/64x64.png
|
||||
// @grant none
|
||||
// ==/UserScript==
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
document.body.addEventListener('click', (event) => {
|
||||
if (event.target instanceof HTMLAnchorElement) {
|
||||
event.preventDefault();
|
||||
|
||||
window.open(event.target.href);
|
||||
}
|
||||
});
|
||||
})();
|
||||
Loading…
Add table
Reference in a new issue