Re: [問題] 如何用GreaseMonkey關閉網頁
我google到的答案 只能自己本機去設定
如果你只是自己用開心的 那就很適合用這招
http://tinyurl.com/44xyjvm
You need to change configuration settings of Firefox (about:config) to
allow this.
Steps:
Go to address bar and type about:config
Go to parameter dom.allow_scripts_to_close_windows
Set its value as true
Now your script can close the TAB with 'window.close()'
eg.
function closeTab(){
window.open('', '_self', '');
window.close();
}
※ 引述《pthuang (◢曉筱◤)》之銘言:
: 我現在會在一個網站上看圖 像這樣
: http://g.xiaoi.com/a/gpqe99mj53vHYD(有時候會出現503)
: 但有時候圖片如果被刪了的話就會自動被導到一個error的網頁
: http://www.xiaoi.com/error.html
: 然後我現在希望在 GreaseMonkey 遇到這網頁的時候就自動關閉
: 在網路上查了一些方法 但是都沒作用
: document.close();
: window.close();
: unsafeWindow.close();
: 我把這些寫在 body 的 onLoad 可是都失敗了
: 請問是我理解錯誤還是 GreaseMonkey 的作法比較特別? m(_ _)m
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.122.30.209
推
07/06 19:00, , 1F
07/06 19:00, 1F
推
07/06 19:03, , 2F
07/06 19:03, 2F
→
07/06 19:38, , 3F
07/06 19:38, 3F
→
07/08 00:52, , 4F
07/08 00:52, 4F
→
07/08 02:11, , 5F
07/08 02:11, 5F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章