MozTW 討論區
https://forum.moztw.org/

請問如何在Firefox 1.0 取消target="_blank"?
https://forum.moztw.org/viewtopic.php?f=2&t=4100
1 頁 (共 1 頁)

發表人:  Coopoo [ 2004-11-16, 11:46 ]
文章主題 :  請問如何在Firefox 1.0 取消target="_blank"?

以往我都是在user.js 裡頭加上
// disable target="_blank" (open in same window):
user_pref("browser.block.target_new_window", true);

升級到1.0 後就沒有效果了.

曾經試過Single Window, 不會開新視窗, 但不是open in same window..
請問我應該怎麼做才能兼顧?

發表人:  訪客 [ 2004-11-16, 16:17 ]
文章主題 : 

Coopoo 寫:
以往我都是在user.js 裡頭加上
// disable target="_blank" (open in same window):
user_pref("browser.block.target_new_window", true);

升級到1.0 後就沒有效果了.

曾經試過Single Window, 不會開新視窗, 但不是open in same window..
請問我應該怎麼做才能兼顧?


最簡單的方式就是裝新版的 tbp 0.9.97,請 tbp 幫你設。

如果不想裝 tbp 那就會稍為麻煩一點,到
about:config

browser.tabs.showSingleWindowModePrefs
設為 true,接著到 工具 -> 選項 -> 進階,將「強迫將視窗開啟於」(大概是這樣,我用的是英文版沒有正確翻譯) 的選項選成 原有的分頁。

然後在
browser.link.open_newwindow.restriction
設為:
0 所有視窗(包括)都開在分頁上
1 允許 js 所開的新視窗都開在視窗上
2 允許規定了視窗大小的 js 新視窗開在視窗上

(1 和 2 的結果我記不清楚了,可能有顛倒)

發表人:  Alextwl [ 2004-11-16, 17:43 ]
文章主題 : 

see [url=http://kb.mozillazine.org/index.phtml?title=Firefox_:_FAQs_:_About:config_Entries#Browser.*]about:config Entries - MozillaZine Knowledge Base[/url].

代碼:
browser.link.open_newwindow.restriction

2: Catch new windows opened by Javascript that do not have specific values set (how large the window should be, whether it should have a status bar, etc.) This is useful because some popups are legitimate -- it really is useful to be able to see both the popup and the original window at the same time. However, most advertising popups also open in new windows with values set, so beware.

發表人:  Coopoo [ 2004-11-16, 17:48 ]
文章主題 : 

謝謝, 已順利解決. :wink:

1 頁 (共 1 頁) 所有顯示的時間為 UTC + 8 小時
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/