Opening a new tab on Google Chrome Extension

后端 未结 3 1985
天涯浪人
天涯浪人 2021-01-04 23:04

This is my background.html file, It works fine when opening in current tab but I want it to open in new tab, what am I doing wrong?


         


        
3条回答
  •  执念已碎
    2021-01-04 23:26

    You should read the chrome.tabs.create documentation again. You are passing it invald parameters. You are also using location which is from the background.html document not the webpage document the code is expecting instead of the tab parameter passed to the chrome.browserAction.onClicked listener.

    
    
    
    
    
    

提交回复
热议问题