I am making a Chrome extension. One part of this extension needs to be able to simulate a click in order to activate the onClick events on the page. Here is the code from the background script: Here is the error message that I am getting from Chrome’s JavaScript debugging: I am guessing that it is something to do with
Tag: google-chrome
How to save the output of a console.log(object) to a file?
I tried using JSON.stringify(object), but it doesn’t go down on the whole structure and hierarchy. On the other hand console.log(object) does that but I cannot save it. In the console.log output I can expand one by one all the children and select and copy/paste but the structure is to big for that. Answer Update: You can now just right click
Open a new tab in the background?
Using javascript, I want to open a new page in a different tab, but remain focused on the current tab. I know I can do it like this: However, when I do this in chrome, it flashes the new tab for a moment before switching back to the current tab. I want to avoid this. The application is a personal
View JSON file in Browser
It is not a programming question, but need your views in few words. When we hit the JSON url in Broswer, it asks us to save the file. Why this happens ? Is there any way to view it on the page itself ? Is there any addon available to view JSON file in browser? Answer In Chrome use JSONView
Access variables and functions defined in page context using a content script
I’m learning how to create Chrome extensions. I just started developing one to catch YouTube events. I want to use it with YouTube flash player (later I will try to make it compatible with HTML5). manifest.json: myScript.js: The problem is that the console gives me the “Started!”, but there is no “State Changed!” when I play/pause YouTube videos. When this
Cross-Origin XMLHttpRequest in chrome extensions
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
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
Stop Chrome Caching My JS Files
I will make a change to my JS files but it won’t really change in the browser, I have to rename the files every time so that it reloads it. Is there some sort of .htaccess command I can add or something to make it stop caching? It is even caching my html pages hard core. I need to reopen
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