Hacking a MV2 extension
-
I use the extension Iframe - Link Viewer to preview any link in a pop-up frame without leaving current page.
You can download at this link in Github
But, it is not updated in 9 years and I want to use it after July 1, 2025.
So I install it in Chromium (without registry policy) but appears this error:
So I changed the manifest version form 2 to 3 in manifest.json file :
and install it again, and this error appears:
I deleted the highlighted errors which appear to be declaratory only and install it again:
There is no errors and extension works fine:
Will the hacked extension pass the purity test on July 1, 2025?
What do you think?
-
@barbudo2005 Should be fine, but you did disable the options menu popup from the extension button.
You can see what you would need to change here: https://developer.chrome.com/docs/extensions/develop/migrate/api-calls#replace-browser-page-actions
Not too complicated. Give it a try, but I can help if you need it.
-
@barbudo2005 if you're interested you could also check my dialog mod which lets you open links or images in a dialog/popup.
-
Said:
but you did disable the options menu popup from the extension button.
I thought the same thing at first, but I checked to see if the options menu was working and it does, only in a tab instead of a pop-up.
I managed to contact the author, and he wasn't very knowledgeable about MV3, but when he checked it out he told me that it seems that the
browser_action
command changed toaction
in MV3. I'm going to try it.There must be many extensions that have the MV2 label but do not occupy the commands that will disappear on 1 July, so hacking them will extend their life. I'm going to try some simple ones that I have MV2 and I use but they are useful.
PS:
Thank you for your willingness to help me.
-
I thought of it as an alternative but it has several problems with regard to extension:
1.- Over a link the extension shows a small square that when clicked opens the iframe, much more comfortable and expeditious.
I enlarged the square and painted it with colour on hover, and with an AHK command the iframe opens without having to click it, even more comfortable.
2.- In the Mod the appearance of the iframe is delayed and even more the appearance of the page. In the extension both are instantaneous.
3.- In the Mod the scrolling is slow and jumpy, in the extension it is fast and smooth.
4.- The extension takes my style of the page with Stylus and the Mod does not. It doesn't consider Dark Reader either.
-
1.- Over a link the extension shows a small square that when clicked opens the iframe, much more comfortable and expeditious.
I don't got the square icon to click, but you can just press and hold the middle mouse button to open.
2.- In the Mod the appearance of the iframe is delayed and even more the appearance of the page. In the extension both are instantaneous.
The website has to load or what do you mean? Does the extension preload all URLs on mouse over and therefore shows the websites faster?
3.- In the Mod the scrolling is slow and jumpy, in the extension it is fast and smooth.
This is something that I didn't noticed yet.
4.- The extension takes my style of the page with Stylus and the Mod does not. It doesn't consider Dark Reader either.
That's true. Sadly I couldn't find a way to display the website and use the installed extensions. That's also a feature that I would like to have.
-
1.- The middle mouse button is not an option to me.
2.- "The website has to load or what do you mean? Does the extension preload all URLs on mouse over and therefore shows the websites faster?"
No.
The fact that it is nine years old and still working perfectly is an indication that it is made with the right commands.
Give a try and you will see.
-
@barbudo2005 my problem with the extension is, that it can't display all websites. This is related to the iFrame that the extension uses.
By the way, the extension doesn't seem to be faster ^^
-
Said:
that it can't display all websites.
I haven't found any site that doesn't display correctly.
And the Tags menu opens without any problem:
-
-
Said;
I clicked on the top left icon of the forum...
Said:
For example github also doesn't work.
That's because Github doesn't allow opening iframes for security reasons, but the few sites like these don't overshadow the superior advantages of the extension.
And for those sites I have the alternative of using the Mod.
-
but the few sites like these don't overshadow the superior advantages of the extension.
Then I was just unlucky with testing it on this websites
And for those sites I have the alternative of using the Mod.
Nice to hear!
-
@barbudo2005 I found a way to display all sites inside of the iFrame. You have to change the
manifest.json
to this:{ "manifest_version": 3, "name": "iFrame - Link Viewer", "description": "Preview any link and search any text in a popup iFrame", "version": "0.8", "content_scripts": [ { "matches": [ "<all_urls>" ], "js": [ "iFrame.js" ], "css": [ "iFrame.css" ] } ], "icons": { "16": "icon_16.png", "48": "icon_48.png", "128": "icon_128.png" }, "host_permissions": [ "*://*/*" ], "permissions": [ "storage", "webNavigation", "tabs", "declarativeNetRequest", "declarativeNetRequestWithHostAccess" ], "options_page": "options.html", "declarative_net_request": { "rule_resources": [ { "id": "remove_headers", "enabled": true, "path": "rules.json" } ] } }
And add a
rules.json
with this content:[ { "id": 1, "action": { "type": "modifyHeaders", "responseHeaders": [ { "header": "Content-Security-Policy", "operation": "remove" }, { "header": "X-Frame-Options", "operation": "remove" } ] }, "condition": { "urlFilter": "*", "resourceTypes": [ "sub_frame" ] } } ]
-
Thank you very much. I will try it.
I always knew that having users making Mods was a good thing.
-
It works flawlessly in Github:
Thank you again. You are the best. No, no, one of the best.
-
Thank you very much!
-
@barbudo2005 just to inform you. I could improve my dialog mod and it supports extensions now
-
Who was the idiot who said that competition is not good for boosting creativity and improving products?
-
@barbudo2005 true! Your posted motivated me to take a look again
-
Hey all, I'm the author of the iFrame - Link Preview Extension
Thank you @barbudo2005 for reaching out to me by email! I didn't know anyone other than myself were using the extension, which was from the Opera era
I've updated the github repo to MV3, also credited @barbudo2005 and @oudstand for the excellent rules.json addition