Chrome-extension: // open about: blank links

I recently contributed to the Enhanced Steam extension, and I found that the link obtained with chrome.extension.getURL just opens roughly: blank, not the link.

I don’t think that in fact the problem is with the extension, but rather the problem is in chrome. The link that it supplies is valid (chrome-extension: //pimjhgjngccknempdnehdeaihcjbajod/options.html), and swimming directly works correctly.

I tried chrome.tabs.create but found that I was not allowed to use it because of modifying the existing contents of the script.

Any help or work around would be appreciated.

+7
google-chrome google-chrome-extension
source share
2 answers

I put all my necessary files in "web_accessible_resources" , it solved my problem. See This at # 4 https://bugs.chromium.org/p/chromium/issues/detail?id=310870#c4

This is a previous Chrome issue that is unsafe. In assembly 31.0.1650.57, Chrome fixed this to force the installation of the required files into "web_accessible_resources" . In the Chrome extension, many samples do not use "web_accessible_resources" , these are errors, these samples will have this "chrome extension: // link open about: blank" problem in assembly 31.0.1650.57.

In fact, my chrome MarkView extension ran into this problem and I had to update its manifest.json to work for this Chrome Update. By the way, MarkView is a tool for reading and writing Awesome Markdown Files, it provides functions, including Content Outline, Sortable Tables, and syntax highlighting of a code block with a line number.

+12
source share

Looks like a bug in Chrome for me. If you do not have as many pages as this to change, could you try using message passing to transfer the page you want to open in the background? Then use window window.open or chrome.tabs.create on the background page. Example code shown below:

 //CONTENT SCRIPT chrome.runtime.sendMessage({greeting: "OpenPage", filename:"somepage.html", querystring:"?aValue="+someVal}, function(response) {}); 

Then on your background page

 //BACKGROUND PAGE chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { if (request.greeting == "OpenPage"){ open_page(request.filename, request.querystring) } }); function open_page(filename, querystring){ var pageUrl = chrome.extension.getURL(filename)+querystring; chrome.tabs.create({'url': pageUrl }, function(tab) { // Tab opened. }); } 
+2
source share

All Articles