I just spent the last 7 hours straight trying to find a way to link directly to a Chrome internal page. For now I have given up. I just instructed people to "right-click and open in new tab".
I have tried everything, from html to css to javascript, but nothing is working. Nothing happens when I click the link, even though right-clicking the link and opening it in a new tab works perfect.
Javascript failed attempts:
<div class="links">
<a href="chrome://net-internals/" onclick="window.open('chrome://net-internals/');">TESTAA</a>
</div>
and
<div class="links">
<a href="chrome://net-internals/" onclick="window.location('chrome://net-internals/');">TESTAA</a>
</div>
There is no error page. Simply nothing happens when you click. If you force it to open in a new tab using target="_blank"
, it only opens a blank tab.
UPDATE! SOLVED!
----- STEP 1-----
Place the following code in the background.html page (background.html is called in the manifest.json):
function openNetInternals() {
chrome.tabs.create({url: 'chrome://net-internals/'});
}
----- STEP 2 -----
Put this code for the link (in the html page):
<a href="chrome://net-internals/" onclick="chrome.extension.getBackgroundPage().openNetInternals()">Net</a>
----- STEP 3 -----
Make sure to refresh the extension. It will work now.