diff --git a/4chan_x.user.js b/4chan_x.user.js index 044ef2d64..232a417bb 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -438,9 +438,6 @@ el.removeEventListener(event, handler, false); } }, - open: function(url) { - return (GM_openInTab || window.open)(location.protocol + url, '_blank'); - }, isDST: function() { /* http://en.wikipedia.org/wiki/Eastern_Time_Zone @@ -496,6 +493,9 @@ return defaultValue; } }, + open: function(url) { + return GM_openInTab(location.protocol + url); + }, set: function(name, value) { name = Main.namespace + name; localStorage.setItem(name, JSON.stringify(value)); @@ -515,6 +515,9 @@ }, set: function(name, value) { return localStorage.setItem(Main.namespace + name, JSON.stringify(value)); + }, + open: function(url) { + return window.open(location.protocol + url, '_blank'); } }); diff --git a/script.coffee b/script.coffee index b34d48329..b936d8b8c 100644 --- a/script.coffee +++ b/script.coffee @@ -347,8 +347,6 @@ $.extend $, for event in events.split ' ' el.removeEventListener event, handler, false return - open: (url) -> - (GM_openInTab or window.open) url, '_blank' isDST: -> ### http://en.wikipedia.org/wiki/Eastern_Time_Zone @@ -420,6 +418,8 @@ $.extend $, JSON.parse value else defaultValue + open: (url) -> + GM_openInTab location.protocol + url set: (name, value) -> name = Main.namespace + name # for `storage` events @@ -435,6 +435,8 @@ $.extend $, defaultValue set: (name, value) -> localStorage.setItem Main.namespace + name, JSON.stringify value + open: (url) -> + window.open location.protocol + url, '_blank' $$ = (selector, root=d.body) -> Array::slice.call root.querySelectorAll selector