google-chrome-extension

Injecting JS functions into the page from a Greasemonkey script on Chrome

I have a Greasemonkey script that works just fine in Firefox and Opera. I struggle with getting it to work in Chrome, however. The problem is injecting a function into the page that can be invoked by code from the page. Here's what I'm doing so far: First, I get a helper reference to the unsafeWindow for Firefox. This allows me to have ...

Does onbeforeunload event trigger for popup.html in a google chrome extension?

I'm writing a google chrome extension with a popup and a background page. The popup subscribes to certain events that the background generates, and I would like to unsubscribe from those events when the popup goes away. However, I don't see either of onbeforeunload or onunload events being generated from the popup. Are these events fired...

Dynamically Inserting Script with Javascript

Long story short I'm working on a Google Chrome Extension. The extensions don't have access to variables in the scope of the page they are operating on by default (you need to communicate through the DOM). What I'm trying to do is insert a script into the page; this works fine by defining a script tag and a src attribute. The problem ...

Gmail seems to capture all keyboard events. Any way to go around that?

I'm writing a Chrome extension that launches a script with a keyboard shortcut. It works fine on most pages but I realized that on Gmail it doesn't: it seems that all keyboard events are captured by Gmail and are not bubbled up to my function. I have a content script (in Chrome extension this is added to any page you want) that has (sim...

store preferences in google chrome extentions

Hi, Using firefox, I can store extension preferences using Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); What interface can I use to store preferences in Chrome? And do they get overwritten on an extension update? Thanks ...

Detecting Google Chrome Browser Extensions

Hey Guys, I was looking for a way to detect the browser extension I am building from my website and I need to alert my users in-case they are viewing my site without it. I have been able to do this in firefox, but I want to know is there a way I can do this in Google Chrome? Even if there is a hack to get this going I am fine. ...

chrome extension first run

Hi, How can I find out if my extension is being run for the first time / has just been upgraded? Thanks! ...

Javascript: Let user select an HTML element like Firebug?

I want to write a browser (Chrome/FF) extension that needs to select an element on a web page. I would like it to behave like Firebug's element inspector does. You click the inspect arrow and you can then hover/highlight elements. When you click on the element you want, the element is inspected. I'm just interested in the code to all...

Chrome Extension: onclick extension icon, open popup.html in new tab

I have created a chrome extension and managed to open the popup.html file using window.open. however I want to open it in a new tab, I've tried lots of different ways including: <script type="text/javascript" language="JavaScript"> chrome.tabs.create('url': 'popup.html'); Am I just placing the code in the wrong place or is it the wr...

Chrome extension help

I want to notify an user using Chrome browser. I need something powerful like changing the Chrome skin colour, highlighting things or at the least like this extension putting an icon on the address bar https://chrome.google.com/extensions/detail/jhejngphiacapbgllhagbpdkkdieeaej Can someone please help? Edit: Q1, can I change the them...

Chrome browser extensions: How to activate page action for all outgoing links of a certain page?

I would like my page action to be activated for all the outgoing links from a certain page. How might I go about doing that? I've gone over the docs to no avail. Any pointers would be appreciated! ...

Chrome Extension

Hi! I should create a google chrome extension.It's a multimedia web recorder. Should I parse http headers (http sniffer), between these take those videos and save. not exist httpFox for Chrome, how could I do? Thanks ...

How to scale an image (in data URI format) in JavaScript (real scaling, not using styling)

We are capturing a visible tab in a Chrome browser (by using the extensions API chrome.tabs.captureVisibleTab) and receiving a snapshot in the data URI scheme (Base64 encoded string). Is there a JavaScript library that can be used to scale down an image to a certain size? Currently we are styling it via CSS, but have to pay performance...

Is there a way to extract the message from a JavaScript dialog in Chrome?

I’ve been working on an extension for automating tests in Chrome, and I came across an obscure issue with JavaScript dialogs. The message shown in the dialog can’t be readily retrieved/copied. I’ve used the GetWindowText and InternalGetWindowText functions, but they only return the title of the dialog and the text from the buttons, not ...

Problem about Chrome Extension

Hi! 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 ...

javascript regular expression select html element with class="product" from string

lets say i use jquery.get to retrive a website to string and how am i gonna select the whole table with class=product from it? $() seem cant work on string .... ...

HEAD XMLHttpRequest on Chromium

I'm trying to get the HEAD response with an XMLHttpRequest in Chromium to retrive the location URL of a compressed url, but it fails: var ajax = new XMLHttpRequest(); ajax.onreadystatechange = function() { if (ajax.readyState == 4) alert(ajax.getResponseHeader("Location")) }; ajax.open('HEAD', "http://bit.ly/4Agih5", false); ajax.send()...

How to re-render a page from a Google Chrome extension?

I'm new to writing extensions for Google Chrome. I want to make an extension that only runs on a few pages (that I'll choose) and re-renders their CSS after the page has loaded (ideally I would like something similar to what you can do with GM_addStyle in greasemonkey scripts). How can I accomplish this in a Chrome extension? ...

call popup.html javascript function from background page

How to call javascript function in popup.html from background page ( in chrome extensions)? ...

Chrome Extension: how to capture selected text and send to a web service

For the Google Chrome extension, I need to capture selected text in a web page and send to a web service. I'm stuck! First I tried a bookmarklet, but Chrome on Mac seems to have some bookmarklet bugs so I decided to write an extension. I use this code in my ext: function getSelText(){ var txt = 'nothing'; if (window.getSe...