Opening a new tab on Google Chrome Extension

后端 未结 3 2026
天涯浪人
天涯浪人 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:15

    
     
      
     
    
     
      
     
    
    

    If you insist on using a popup and want it to close as soon as it is opened, then use what is above. Simply add the link string and a true boolean to the master.newtab function to have it open the new tab and then close the popup.

    If you change your mind about closing the popup, you can replace the true boolean with a function to execute if the new tab was created without any errors. You can also use the master.link function for calling the master.newtab function from an anchor element.

    The best thing about using Chrome Extensions is you never have to worry about support issues! :D

提交回复
热议问题