add x-browser GM_openInTab; add t - tabopen
This commit is contained in:
parent
5be92870f6
commit
49f2251008
@ -50,6 +50,14 @@ AEOS =
|
|||||||
style.type = 'text/css'
|
style.type = 'text/css'
|
||||||
style.textContent = css
|
style.textContent = css
|
||||||
document.getElementsByTagName('head')[0].appendChild style
|
document.getElementsByTagName('head')[0].appendChild style
|
||||||
|
window.GM_openInTab = (url) ->
|
||||||
|
form = document.getElementById 'GM_form'
|
||||||
|
form.action = link
|
||||||
|
form.submit()
|
||||||
|
form = document.createElement 'form'
|
||||||
|
form.id = 'GM_form'
|
||||||
|
document.body.appendChild form
|
||||||
|
|
||||||
#dialog styling
|
#dialog styling
|
||||||
GM_addStyle '
|
GM_addStyle '
|
||||||
div.dialog {
|
div.dialog {
|
||||||
@ -361,7 +369,7 @@ iframeLoad = ->
|
|||||||
|
|
||||||
keyboardNav = (e) ->
|
keyboardNav = (e) ->
|
||||||
char = String.fromCharCode e.keyCode
|
char = String.fromCharCode e.keyCode
|
||||||
unless char in '1234567890GHJKLO'
|
unless char in '1234567890GHJKLOT'
|
||||||
return
|
return
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
hash = location.hash
|
hash = location.hash
|
||||||
@ -407,6 +415,9 @@ keyboardNav = (e) ->
|
|||||||
when "O"
|
when "O"
|
||||||
qrLink = $ "#{hash} ~ span[id] a:not(:first-child)"
|
qrLink = $ "#{hash} ~ span[id] a:not(:first-child)"
|
||||||
quickReply.call qrLink
|
quickReply.call qrLink
|
||||||
|
when "T"
|
||||||
|
href = $("#{hash} ~ span[id] a:last-of-type").href
|
||||||
|
GM_openInTab href
|
||||||
g.count = 0
|
g.count = 0
|
||||||
|
|
||||||
nodeInserted = (e) ->
|
nodeInserted = (e) ->
|
||||||
|
|||||||
18
4chan_x.js
18
4chan_x.js
@ -22,6 +22,7 @@
|
|||||||
};
|
};
|
||||||
AEOS = {
|
AEOS = {
|
||||||
init: function() {
|
init: function() {
|
||||||
|
var form;
|
||||||
if (!(typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null)) {
|
if (!(typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null)) {
|
||||||
window.GM_setValue = function(name, value) {
|
window.GM_setValue = function(name, value) {
|
||||||
value = (typeof value)[0] + value;
|
value = (typeof value)[0] + value;
|
||||||
@ -50,6 +51,15 @@
|
|||||||
style.textContent = css;
|
style.textContent = css;
|
||||||
return document.getElementsByTagName('head')[0].appendChild(style);
|
return document.getElementsByTagName('head')[0].appendChild(style);
|
||||||
};
|
};
|
||||||
|
window.GM_openInTab = function(url) {
|
||||||
|
var form;
|
||||||
|
form = document.getElementById('GM_form');
|
||||||
|
form.action = link;
|
||||||
|
return form.submit();
|
||||||
|
};
|
||||||
|
form = document.createElement('form');
|
||||||
|
form.id = 'GM_form';
|
||||||
|
document.body.appendChild(form);
|
||||||
}
|
}
|
||||||
return GM_addStyle('\
|
return GM_addStyle('\
|
||||||
div.dialog {\
|
div.dialog {\
|
||||||
@ -445,9 +455,9 @@
|
|||||||
return recaptchaReload();
|
return recaptchaReload();
|
||||||
};
|
};
|
||||||
keyboardNav = function(e) {
|
keyboardNav = function(e) {
|
||||||
var _i, _len, char, count, hash, position, qrLink, temp;
|
var _i, _len, char, count, hash, href, position, qrLink, temp;
|
||||||
char = String.fromCharCode(e.keyCode);
|
char = String.fromCharCode(e.keyCode);
|
||||||
if (!((function(){ for (var _i=0, _len='1234567890GHJKLO'.length; _i<_len; _i++) { if ('1234567890GHJKLO'[_i] === char) return true; } return false; }).call(this))) {
|
if (!((function(){ for (var _i=0, _len='1234567890GHJKLOT'.length; _i<_len; _i++) { if ('1234567890GHJKLOT'[_i] === char) return true; } return false; }).call(this))) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -515,6 +525,10 @@
|
|||||||
qrLink = $("" + (hash) + " ~ span[id] a:not(:first-child)");
|
qrLink = $("" + (hash) + " ~ span[id] a:not(:first-child)");
|
||||||
quickReply.call(qrLink);
|
quickReply.call(qrLink);
|
||||||
break;
|
break;
|
||||||
|
case "T":
|
||||||
|
href = $("" + (hash) + " ~ span[id] a:last-of-type").href;
|
||||||
|
GM_openInTab(href);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return (g.count = 0);
|
return (g.count = 0);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user