Google Chrome Extensions - Open New Tab when clicking a toolbar icon

后端 未结 3 1058
后悔当初
后悔当初 2020-11-29 00:27

How can I create an extension for Chrome that adds an icon to the toolbar, and when you click it, it opens a new tab with some local web page (for example: f.html)?

3条回答
  •  鱼传尺愫
    2020-11-29 00:59

    chrome.tabs.create need the permission of "tabs".

    Simply using window.open in extension without need of any permission. and the code is shorter. I suggest this solution.

    window.open(url,'_blank');
    

提交回复
热议问题