haha oh wow, one-liner GM_openInTab

This commit is contained in:
James Campos 2010-11-14 23:09:59 -08:00
parent 7023841e48
commit a744036e1f
2 changed files with 2 additions and 16 deletions

View File

@ -51,13 +51,7 @@ AEOS =
style.textContent = css style.textContent = css
document.getElementsByTagName('head')[0].appendChild style document.getElementsByTagName('head')[0].appendChild style
window.GM_openInTab = (url) -> window.GM_openInTab = (url) ->
form = document.getElementById 'GM_form' window.open url, "_blank"
form.action = url
form.submit()
form = document.createElement 'form'
form.id = 'GM_form'
form.target = '_blank'
document.body.appendChild form
#dialog styling #dialog styling
GM_addStyle ' GM_addStyle '

View File

@ -22,7 +22,6 @@
}; };
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;
@ -52,15 +51,8 @@
return document.getElementsByTagName('head')[0].appendChild(style); return document.getElementsByTagName('head')[0].appendChild(style);
}; };
window.GM_openInTab = function(url) { window.GM_openInTab = function(url) {
var form; return window.open(url, "_blank");
form = document.getElementById('GM_form');
form.action = url;
return form.submit();
}; };
form = document.createElement('form');
form.id = 'GM_form';
form.target = '_blank';
document.body.appendChild(form);
} }
return GM_addStyle('\ return GM_addStyle('\
div.dialog {\ div.dialog {\