Skip to content Skip to sidebar Skip to footer

Chrome Extension Help - What's The Process For Adding The Url Of An Open Page To The Html Of The Default_popup In Manifest.json

I've got the following manifest: { 'name':'Fix the Web extension', 'version':'0.2', 'manifest_version':2, 'description':'Web accessibility Poorly designed websites

Solution 1:

extension.js

chrome.tabs.query({active:true,currentWindow:true},function(tabArray){
    document.getElementById("eltId").src
        = "http://www.fixtheweb.net/frame/report?url="+tabArray[0].url;
});

and add "permissions": ["activeTab"] to your manifest. Then, to load it from extension.html, you'll need:

<body><iframeid="eltId"src="http://www.fixtheweb.net/frame/report"height="350"width="300"></iframe><scripttype="text/javascript"src="extension.js"></script></body>

I'm honestly surprised it didn't end up taking more.

Solution 2:

wooo, nearly nearly... I replaced extension.html with the source page, and made all the urls to the full urls... and now it works and is faster but the extension.js is no longer pre filling the url of the open page.

what I tried was changing the js so that it reads as below because "report-form" is the id of the form (the source of which can be found at http://www.fixtheweb.net/frame/report of course)

chrome.tabs.query({active:true,currentWindow:true},function(tabArray){
    document.getElementById("report-form").src
        = "http://www.fixtheweb.net/frame/report?url="+tabArray[0].url;
});

we need people (reporters) to fill in their email address because that's how volunteers can get back to reporters if they have queries, or want to tell them about fixes, or if reporters want to catch up on where the issue is getting to... I'm hoping the extension will work whether you are logged in or not. Sadly this way even when you are logged in the email address no longer pre fills... but if I had to compromise on that for a faster form load I think that's worth it as reporters won't always be logged in.

Post a Comment for "Chrome Extension Help - What's The Process For Adding The Url Of An Open Page To The Html Of The Default_popup In Manifest.json"