How do I get my google chrome extension to interact with pages outside the extension? - google-chrome-extension

So I've built the main functionality for an extension already, and have it uploaded as a web page on my server. I'd like to have it interact with any page a visitor goes to though and not just my page on the server. It's just the HTML/CSS/Javascript and jQuery.
I've been reading the documentation, and it says/implies I need to use a content script. I do have this script included as a content script as well though, however I'm probably doing it wrong. Mainly looking for some guidance/direction as to where to go on this.
The extension is to be one that removes all images from a page.
The site is http://199.127.226.221/testsites/chromeapp/
This is the manifest file: http://199.127.226.221/testsites/chromeapp/manifest.json
This is the .crx file: http://199.127.226.221/testsites/chromeapp/chromeapp3.crx

You should supply the extension as a .crx file.
Also it seems you should specify desired urls for content scripts in permissions of manifest

Related

Get a friendly name for browser/computer

Is it possible to retrieve the computer name when developing a Chrome Extension, for example "Jenny-PC"?
At first glance I did not find the API, but maybe I missed something.
If you are quite the daredevil, you could try to extract that info from a NPAPI plugin. This is quite dangerous, as you can read more about on the chrome extension site
No directly, for security reasons extensions can't access OS services.
But, hacker way, you may find some odd way to get what you're looking for.
If your extension has file:// permission, it can read system configuration files.
If you can get the user drop some file containing the name you want on some receiver in your extension's page, you can read it with HTML5 FileReader object.
If you can get the user download and execute some script you wrote (for example a .bat in Windows), it can grab that name and send to the extensions in various ways:
- writing it in a file the extension can read
- executing something like
"c:\chrome install folder\chrome.exe" chrome://extensions/yourextensionkey/receiver.html?name=thenameyourellokingfor
About file:// permission
Chrome Web Store doesn't allow uploading nor publishing extensions with such permission. But the extension works if you install it as a developer, or as .crx .
I'm not sure, but I think you can upload it to Chrome web store modifying it, in order to ask for permission.

How to display website in SWF files

I would like to create a shockwave file that can display a website with an internal webbrowser or something similar. The final target to display the website in a pdf file, but I think the only way to do this, is the swf trick.
I tried to find resources for this on the web, but found nothing.
UPDATE:
I am looking for a way to display a website in a downloadable pdf file. The website is only one html file fuelled by jquery and css.
Download SWF template for your website and edit it in macro media flash editor.
I would use a PHP script to create a PDF file (my choice for this kind of stuff is TcPDF, which has many example/how to scripts ready to use), and I'd put a captured image of my website in it; there are several websites offering this service for free, just google it, for example webthumbnail.org.
Disclaimer: I'm not linked to TcPDF nor Webthumbnail.org in any way, they are just the first examples that came into my mind.

How to detect in advance if a browser will download a file instead of viewing it?

Sometimes when you view a file on a page on its own, the browser has some default way of viewing it, like to place it in an image or video tag, or invoke some plugin. Other times, it just downloads the file.
Sometimes this is because of headers set by the server, but lets ignore that for now. For some file types, it doesn't matter what headers were set -- the browser will try to download them regardless.
Some of the types that the browser will view are listed in navigator.mimeTypes. However, this is not authoritative. The iPad can view Microsoft Office files but it does not report this.
Is there any simple way to figure out what the browser is going to do with a file before it does it?

How to prevent a site from checking for my manifest file?

I have a popular Chrome extension that is being targeted by a specific site and they are messing with our extensions functionality and telling visitors to uninstall our extension. They are detecting we are running in the browser by checking for our manifest file via looking for the URL chrome-extension://our-app-id/manifest.json. Is there anyway I can prevent this?
I tried using content-security-policy but that seems to only help with cross-scripting. If not seems like a security hole on google's part; I don't want sites knowing what extensions I am running in my browser.
Manifest version 2 that is tentatively scheduled for version 18 should fix this.
[...] today, all the resources inside your extension (e.g., images)
are visible to web pages. We're changing the default to "not visible"
and then adding a manifest attribute to let you whitelist the
resources that you want to be accessible to web pages.

Problem about Chrome Extension

I try to write an extension and i saw the very restricted policy security.
I should create an extension that allows me to listen and download podcast from web. It is possible?
I use Chrome OS with VMWare, this OS has additional Api than Google Chrome Browser?
Thanks
Yes it is possible to have a content scripts that executes on every page looking for specific media content. The content page could send a request back to the extension to indicate it has found a media file and using the URL you could play it in an tag inside the extension.

Resources