Programmatically open a Chrome plugin's options.html page?

前端 未结 4 1370
深忆病人
深忆病人 2020-12-07 21:22

Is there a way to open a Google Chrome plugin\'s options.html page via Javascript in background.html?

4条回答
  •  余生分开走
    2020-12-07 22:09

    chrome.tabs.create({ url: "options.html" });
    

    Update

    Starting with version 40, Chrome now uses a new popup options dialog from the extension management page instead of dedicated options pages (which are being deprecated). You can still achieve the same effect with a modification to the URL.

    chrome.tabs.create({ 'url': 'chrome://extensions/?options=' + chrome.runtime.id });
    

提交回复
热议问题