Work around GM3.0 GM_openInTab bug.

This commit is contained in:
ccd0 2015-03-14 23:58:15 -07:00
parent ae9e15478a
commit d46d02f249

View File

@ -221,6 +221,10 @@ $.event = (event, detail, root=d) ->
$.open = $.open =
<% if (type === 'userscript') { %> <% if (type === 'userscript') { %>
if GM_info.version is 'unknown' # GM_info.version is broken in GM3.0
# XXX https://github.com/greasemonkey/greasemonkey/issues/2094
(URL) -> $.globalEval "window.open(#{JSON.stringify URL}, '_blank');"
else
GM_openInTab GM_openInTab
<% } else { %> <% } else { %>
(URL) -> window.open URL, '_blank' (URL) -> window.open URL, '_blank'