Link to chrome://chrome/extensions from extension options page

我的梦境 提交于 2019-12-30 03:09:27

问题


I'm using the chrome bootstrap styles (see http://roykolak.github.com/chrome-bootstrap/) to build my options page. Now I'd like to have a link back to chrome://chrome/extensions in the left-sidebar menu, but clicking on it returns an error in the console: Not allowed to load local resource: chrome://chrome/extensions


回答1:


You can open this with chrome.tabs.update, you don't need the tabs permission for this.

options.html

<script src="options.js"></script>
<a href="#" id="test">test</a>

options.js

document.addEventListener('DOMContentLoaded', function() {
    document.getElementById('test').addEventListener('click', function() {
        chrome.tabs.update({ url: 'chrome://chrome/extensions' });
    });
});


来源:https://stackoverflow.com/questions/13125616/link-to-chrome-chrome-extensions-from-extension-options-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!