Search code examples
google-chrome-extensionchrome-extension-manifest-v3

Not allowed to load local resource when opening chrome:// UI page from a chrome extension


I have a MV2 Chrome extension that on the popup page I added a "Shortcut" link so that user can access chrome://extensions/shortcuts by clicking it.

However, after upgrading to MV3, the link doesn't work.

enter image description here

Should I simply remove this feature?


Solution

  • You can resolve this issue by opening the page programmatically.

    1. add some suitable selector to the link (popup html):
    <a href="#" id="commands-link">Configure Commands</a>
    
    1. add an event listener to open the shortcuts page (in popup script):
    // get the DOM node
    const link = document.getElementById("commands-link");
    
    // add click event handler that opens the shortcuts page
    link.addEventListener('click', () => chrome.tabs.create({
        url: "chrome://extensions/configureCommands"
    }));