2012-03-14 54 views
2

在Chrome中我通常有10-15個選項卡中打開和我經常做兩件事情:防止鉻疏忽造成標籤關閉等

上你點擊它們時,因爲我打的X,而不是一不留神關閉的選項卡。

意外地將瀏覽器上的標籤拖到他們自己的新窗口中。

哪個擴展可以防止這種情況發生。如果可能的話,我會禁用X,並拖動到新的窗口功能。寫一個擴展來做到這一點是多麼容易。

+0

不然而:http://groups.google.com/a/googleproductforums.com/forum/#!category-topic/chrome/report-a-problem-and-get-troubleshooting-help/UBPg5GuRDKM – 2012-03-14 16:49:24

+0

其實,我不小心關閉了標籤比將其從瀏覽器拖出更頻繁 - 但兩者都非常煩人和不方便。只需要一個上下文菜單選項。 – Mark 2012-03-14 16:59:52

+0

作爲一個方面說明,文件菜單中有一個「重新打開關閉標籤」選項(Mac上的command-shift-T),這可能是意外關閉標籤的更直接的解決方案。 – 2012-03-15 08:45:49

回答

0

我會寫我的第一個Chrome擴展,並在完成後提供更新。使用chrome.tabs自動固定創建的每個新選項卡應該是一件簡單的事情。


代碼是微不足道的這樣:

bg.html:

<script src="bg.js"></script> 

bg.js:

var id = 0; 

chrome.tabs.onCreated.addListener(function(tab) { 

    id = tab.id; 

    var t = setTimeout("update_tab()",100); 

}); 


function update_tab() { 

    updateProperties = new Object(); 
    updateProperties.pinned = true; 

    chrome.tabs.update(id, updateProperties); 

} 

manifest.json的:

{ 
    "name": "FanTabStick", 
    "version": "1.0", 
    "description": "Pin down all tabs automatically", 
    "background_page": "bg.html", 
    "icons": { "128": "icon.png" }, 
    "permissions": [ 
    "tabs" 
    ]}