According to chrome extensions API cross-origin calls using XMLHttpRequest object should be allowed if permissions are set: An extension can talk to remote servers outside of its origin, as long as it first requests cross-origin permissions. I am closely following the Google tutorial, but the code below is giving me an error message: XMLHttpRequest cannot load http://www.google.com/search?hl=en&q=ajax. Origin chrome-extension://bmehmboknpnjgjbmiaoidkkjfcgiimbo is
Tag: google-chrome-extension
Can I inject a CSS file programmatically using a content script js file?
Can I inject a CSS file programmatically using a content script js file? It is possible for me to inject the css when the js file is linked to my popup.html. The problem is I have to click on the button to open the popup to inject the css. I want it to happen automatically and in the background. What
Google Chrome “Application Shortcut”: How to auto-load JavaScript?
Introduction Google chrome has a feature that allows you to create shortcuts to web pages and make them appear like traditional desktop applications. For example, a shortcut to twitter mobile might be The file icon for this app is stored in My Question It’s been a while since I’ve used this feature and I seem to remember that you could
Chrome extension to read HTTP response
I have this Chrome extension that modifies the header of requests before sending them. I now would like to be able, within the same extension, to check the header of the response. I searched throughout the Chrome Extension APIs but I couldn’t find anything of interest. This is the code I use for modifying the header of the request, maybe
Chrome extension: Get last used tab
I’m trying to create a simple plugin for Google Chrome. One of the functions would be a return to the last used tab, but I don’t know how to do it. So, is there any way to get the last used tab? Answer You could try adding a hook into the onSelected event of the tabs and just saving that
Loading external javascript in google chrome extension
I’m writing a Google Chrome extension which manipulates the current page (basically adds a button). In my content script, I want to load the Facebook Graph API: However, the script doesn’t seem to added to body. Here’s the console log: Any ideas on what I’m doing wrong? Answer The issue is that the JavaScript inside the content scripts runs in
Detecting if code is being run as a Chrome Extension
I am working with some code that needs to be run as a page, and if it’s being run as a Chrome Extension, I want to be able to do additional things. What I’m using is: This seems like a good capability detection. Using user agent string causes me trouble because it’s the same no matter the context (web page
Increase (youtube flash) video’s sound volume by means of JavaScript
Background story: many users (including me) browse the web from notebooks that are not constructed for sound performance. That means (besides other things) that the sound volume for most videos is too low, especially if the video itself is recorded at low volume. Therefore… I was wondering if there is any way of increasing the volume of such a video
Check whether user has a Chrome extension installed
I am in the process of building a Chrome extension, and for the whole thing to work the way I would like it to, I need an external JavaScript script to be able to detect if a user has my extension installed. For example: A user installs my plugin, then goes to a website with my script on it. The
Getting cookies in a google chrome extension [duplicate]
This question already has answers here: How do I return the response from an asynchronous call? (41 answers) Closed 25 days ago. I am trying to get a cookie specifically from a domain using this code: The problem is that the alert always says undefined. However, if I change to it works properly. How do I save the value to