FAQ Database Discussion Community


Chrome extension sending message from iFrame to event page then to content script

html,google-chrome,iframe,google-chrome-extension
I have inserted an iframe from content script. It works fine. But if I want to display parent's html content on iframe, I have to use messaging to communicate between iframe and content script, but it doesn't work. Then I tries to send message from iframe to "event page" then...

Background youtube player

google-chrome-extension,youtube-api
I am trying to make a Chrome extension such that to play songs from youtube. I have done this but I have a small problem. When I click the extension icon, a popup appears where I can search the song and play it, but when the popup disappears, the music...

IndexedDB: Can you manually initiate a version change transaction?

javascript,html,javascript-events,google-chrome-extension,indexeddb
I am writing a chrome extension that utilizes IndexedDB to store some information client side in an IDBObjectStore within an IDBDatabase. The nature of the data is such that I need my users to be able to modify the object store at their whim. (add new objects modify existing ones...

Removing permissions of the extensions

javascript,google-chrome-extension,google-drive-sdk,access-token
I have an extension that first asks for permissions to access Google Drive files. The extension is almost empty except in the popup I load this js: chrome.identity.getAuthToken({ 'interactive': true }, function(token) { // Use the token. console.log('Request Token') console.log(token) chrome.identity.removeCachedAuthToken( { 'token': token }, function () {}) console.log('Removed token')...

chrome extension cannot send message after extension reload

javascript,google-chrome,google-chrome-extension
I'm currently developing a chrome extension that is mainly driven by a JS application. I'm able to send message between application and background page using long-lived connection until I reload the extension. Once it's reloaded, there is no way to connect to it (either from a content script or from...

Cross-Domain OAuth… how to get response?

javascript,google-chrome-extension,oauth,cors
I'm creating a Chrome Extension which will interact with a particular popular website. It injects html into the site which adds new features. Parts of these features depend on the user being logged in, and in order to get that logged in user information, we need to to authenticate the...

Set chrome extension cookie value name as var

javascript,google-chrome,google-chrome-extension
I'm working on chrome extension and need to set a cookie: chrome.cookies.set({ url: "https://www.someurl.com/", name: value }); This code works good but "name" should be dynamic var that ajax passed. var name = response; Is it posible?...

Can I fire up a Chrome extension API from code?

javascript,google-chrome,google-chrome-extension
Is it possible to launch a Google Chrome extension within a website? E.g run some javascript that will launch the extensions UI? I'm building a web-app that will allow users to take screenshots of their desktop and edit them. I've got a sample extension up and running using dektopCapture but...

when chrome extension gets updated does the data stored in local storage gets deleted?

google-chrome,google-chrome-extension
I have searched through google spec about chrome storage, but was not able to get a definite answer to my question. I am currently writing my first chrome extension, in which I store the data into a local storage. The thing that is bothering me is that when I release...

Chrome extension add iframe and access parent window content

angularjs,iframe,google-chrome-extension
I inject a iframe from content script into a page. The iframe run an angular application. I want to access the parent window's content from this angular script. How can I do it? Partial manifest.json "content_scripts": [ { "css": [ "css/inject.css" ], "js": [ "scripts/inject.js" ], "run_at": "document_end", "all_frames": false...

detect requests calls in a url similar to network in chrome dev tools

javascript,google-chrome,google-chrome-extension,google-chrome-devtools
I don't know if what I am looking for is possible, I want JS, or any other programming method solution to detect the requests calls for a given url page, something similar to chrome dev tools There is a site that displays videos, I would like to access through the...

Overly strict warning from Chrome Web Store for using a public API

javascript,json,google-chrome,google-chrome-extension,chrome-web-store
I recently made a Chrome Extension (FrontPage) which uses the New York Times API. I send an AJAX request to the API and it responds with JSON. However, in order to be able to do so, I need to set permissions in the manifest.json file to be https://api.nytimes.com/* thusly: ......

Simple Chrome Extension : Open an url in a new tab

google-chrome-extension
I'm looking to create a "new tab" extension like Panda or the Product Hunt Extension: the user can open a new tab with my website inside, with an hidden url. I've generated my package with the awesome Extensionizr and here is my manifest.json : manifest.json { "name": "My app", "version":...

How to force loading images for the webpages installed “lazy load” without scrolling?

javascript,google-chrome-extension,lazy-loading
I implement a Chrome extension. The extension needs to get all images URLs of webpages. However, some webpages have "lazy load" plug-in. My question is if it is possible that I can still get URLs without required manually scrolling down?

Chrome extension console.log override

javascript,google-chrome,google-chrome-extension
I'm building a chrome extension that reads the console log and find where an ip appears, after the string "Connecting to", and gets the ip. store = []; var oldf = console.log; console.log = function(){ store.push(arguments); oldf.apply(console, arguments); }; pos = 0 server = "" setTimeout(function(){ for(i = 0; i...

Chrome opens multiple tabs through background script but writes to console only once [closed]

javascript,google-chrome,google-chrome-extension
I was trying to write a background script that creates a new tab if a stored item isn't found but it opens up hundreds of new tabs. While chrome's create tab function opens multiple tabs through the background page, console.log are run just once. Why exactly is that? For example:...

Chrome Extension detect button inside extension

javascript,google-chrome,google-chrome-extension
I am building a simple chrome extension and I need it to change the background color of the selected tab page on clicking a button thats within the extension popup. <button id="btn">Change</button> I have tried this: var b = chrome.extension.getElementById('btn'); b.onClicked.addListener(function(tab) { chrome.tabs.executeScript({ code: ' document.body.style.backgroundColor = "#000" ' });...

management permissions for chrome extension in content script

google-chrome-extension
I have an chrome extension that should check whether another extension and add a div to every web page in my-website.com if it is not. So i put this in the manifest: "background": { "scripts": ["background.js"] }, "content_scripts": [ { "matches": ["http://my-website.com/*"], "js": ["content.js"], "run_at": "document_end", "all_frames": true } ],...

chrome.runtime.onInstalled is undefined

javascript,google-chrome,google-chrome-extension
I want to launch the options after my extension got installed. Here are many answer to this issue which I tried to use in this case. My problem is that chrome.runtime.onInstalled is undefined. This is my source code: background.js if(typeof chrome.runtime.onInstalled !== 'undefined') { chrome.runtime.onInstalled.addListener(function (details) { //if(details.reason == 'update')...

“Referer” header is missing when user clicks on a link from inside an iframe that overrides a newtab in Chrome

iframe,google-chrome-extension,http-headers,http-referer
Question Is it an expected behavior of a browser acting like that? Related Chromium bug https://code.google.com/p/chromium/issues/detail?id=492761 Steps create an empty extension for Chrome put a newtab override into manifest.json: "chrome_url_overrides": {"newtab": "newtab.html"} create newtab.html (chrome-extension://<extension_id>/newtab.html), create an iframe and load some page into it, e.g. https://<some_page>.com/ put a link to...

Passing a response callback via promise between background and content script? [duplicate]

javascript,google-chrome-extension
This question already has an answer here: Chrome Extension Message passing: response not sent 2 answers I'm trying to inject an html template into the DOM of a webpage via a content script. I prefer to keep the html files in their own folder within the extension so that...

How to check how many elements of a certain type has a page with Chrome Extension Dev

javascript,jquery,google-chrome,google-chrome-extension
I have a simple custom Chrome Extension I've looked all over the web for this and nothing good showed up. I want to read how many elements of a certain type are in a page, through my popup.js file. Something like this: $('div').length Is it possible to do this through...

Optional permission for filesystem

google-chrome,google-chrome-extension,google-chrome-app
Is it possible to mention filesystem as an optional permission requested by chrome.permissions.request API (for Chrome apps)? My JS code includes : document.getElementById('savebtn').addEventListener('click', function () { chrome.permissions.request({ permissions: ["fileSystem"] }, function (granted) { if (granted) { chrome.fileSystem.chooseEntry({ type: 'openDirectory' }, function (entry) { ... }); } }); }); but I...

Using openweathermap api for free

google-chrome-extension
Can I use openweathermap api for free in a chrome extension? I am trying to build a chrome extension which will use openweather map api. Can I use it for free if I want to place it on webstore?

Chrome extension: Getting html of page before page renders/loads

javascript,jquery,html,google-chrome-extension
Context: I'm making a program that extracts the main content from a webpage. However, currently what I am doing is waiting for the entire webpage to load and render (which can take a long time, especially for pages with a lot of scripts). What I want is to just get...

Constantly check the length of an element and perform an action if it is ever 1

javascript,jquery,events,javascript-events,google-chrome-extension
I have an element on a page that I am constantly monitoring. If at any time that length is equal to 1, it means it exists on the page (the user has logged out) and I want to prompt them with a popup to login. So at the moment I...

Is there a way to view chrome.storage.local in Developer Tools?

google-chrome,google-chrome-extension,google-chrome-devtools
I have a Chrome Extension and I'm able to view background page localStorage on the Resources tab of Developer Tools. Is there a way to do the some for chrome.storage.local?...

Access DOM elements data document->Iframe ->Iframe->method chrome extension

javascript,google-chrome,iframe,google-chrome-extension
I'm trying to access some data from an iframe nested within an iframe, from developers console: Object.keys(document.getElementById("contentBody"). contentDocument.getElementById('rawContent'). contentDocument.defaultView.window.messages) ["29c736c0ed25463c8436f4990ab6c6ec.zip", "235819a8cf11488e83f0336603b71711.zip", "66c9260590834d9698568c8a676ef406.zip", "fae95e31cb424cd6ad21302217ef2cdc.zip", "f554f712141047aa9aa24f765073e305.zip", "e5c41819578240e0868f43ab6301aeb3.zip"] That's what I expect back, but I've tried to get that...

can't submit form in chrome extension

javascript,html,html5,google-chrome,google-chrome-extension
I have been working in a new chrome extension, and i am Beginner I have a form with login details (username and password) and i want to check username and password with database and move to another page or form in this extension. popup file Local Storage Encoding Local Storage...

Mismatched anonymous define() in Chrome extension content script

google-chrome-extension,requirejs,typescript
I'm trying to build a Chrome extension with TypeScript. The setup is quite simple: In manifest.json { "permissions": [ "webRequest", "webRequestBlocking", "tabs", "storage", "http://*/", "https://*/*" ], "content_scripts": [ { "matches": [ "http://*/*", "https://*/*" ], "js": [ "scripts/require.js", "scripts/require-cs.js", "scripts/main.js", "scripts/contentscript.js" ], "run_at": "document_end", "all_frames": true }], } In model.ts: export...

chrome store extension private rsa key

google-chrome-extension,pem
I uploaded an extension to the chrome store without generating a .pem for it. I want however to distribute the package independently of chrome store to beta testers as well. Is there a way to get the private key that google assigned to my extension?

Programmatically upload a file from chrome extension. How to?

google-chrome,google-chrome-extension
I need to upload a local file to a remote server from a chrome extension. The extension extends chrome file browser and I'd like to invoke the upload when a user 'opens' a file with my extension. I was hoping to use sockets APIs but just realised (hard way) that...

What is the easy way of installing chrome app from folder, for development, after loading will be disallowed?

google-chrome,google-chrome-extension
Google Chrome will start disallowing developers from installing Chrome apps by loading them from a folder as it's possible today (see the recent news from chromium team). However, the proposed solution seems really complicated to me and I don't understand it at all (for example, I don't have any CRX...

Chrome identity launchWebAuthFlow only opens empty callback page

javascript,google-chrome-extension,callback,oauth-2.0,identity
Sorry for yet another probably noob question, normally I don't give in until I find a solution myself but this one has me going for 3 days and it is time to admit I'm stuck... I'm trying to authenicate a Chrome extension to use PushBullet user data via OAuth2: background.js...

JavaScript OOP and asynchronous methods from Chrome extension api

javascript,google-chrome,oop,asynchronous,google-chrome-extension
I am making a chrome extension and its uses little blocks of text. I made a class and each block is an instance of that class. Such that: function Block(bid){ var block = Object.create(Block.prototype); block.title = "Default" block.content = ""; block.bid = bid; return block; }; Block.prototype.setTitle = function (){...

Make an animated Chrome extension icon?

javascript,google-chrome,google-chrome-extension,icons,animated
I am trying to make a new Chrome extension, and I need the icon to automatically change like a gif with an array of images, and repeat forever. My problem is I can't get the Javascript loop to work. Here is what I've got: var min = 1; var max...

Is there a way to close a chrome extension popup, when the user is on a separate chrome window?

javascript,google-chrome,google-chrome-extension,popup
The scenario that I'm trying to get to work is: If the user opens the extension popup on Chrome Window 1, and does not close the popup, the instant that the user opens another Chrome Window (Window 2) and starts working with it, I want the popup on Window 1...

Google Chrome extension that sends a image url into a specific text field

javascript,jquery,html,google-chrome,google-chrome-extension
I am trying to make a google chrome extension that allows a user to click on in image in the popup window and have the images url sent to a specific websites text field; I see nothing wrong with my code but it refuses to work. Here is my manifest.json...

Request with google chrome api

google-chrome,google-chrome-extension,google-chrome-app
I'm developing an extension for google chrome, where I hear the commands CTRL + SHIFT + 1 and CTRL + SHIFT + 2 and I store the text of the mouse selection. When the user hits CTRL + SHIFT + 3 or CTRL + SHIFT + 4 I would like...

Running Apps Script from Chrome extension requires authorization

google-chrome-extension,google-apps-script
I'm trying to execute a Google Apps Script from an event on my Chrome extension. While it works great, when ran for the first time by a new user, the apps script requires for the user to give it authorization before it can execute. The problem is when running the...

This extension doesn't work for me?

javascript,json,google-chrome,google-chrome-extension
This is inside my manifest.json: { "manifest_version": 2, "name": "ROBLOX Forum Link Fixer", "description": "Fixes the amp; issue on the ROBLOX forum.", "version": "2.0", "background": { "scripts": [ "jquery.js", "fixer.js" ] }, "permissions": [ "http://*.roblox.com/*", "https://*.roblox.com/*" ] } and this is inside of fixer.js (jquery.js is just jQuery): $(document).ready(function(){ $('.rbx-link.user-link').each(function(){...

Chrome Extension: Is it possible to create a TCP/Websocket based server on a folder?

javascript,google-chrome,tcp,google-chrome-extension
Are there any ways to create a server hosted at 127.0.0.1 which will host a folder from within a Chrome (non-legacy) Extension? We want the extension to be used as part within the dev team, so a non-legacy version is what we are looking at. Followed this link: https://github.com/kzahel/web-server-chrome which...

How does an unpublished extension get weekly users?

google-chrome-extension,chrome-web-store
This is weird. I have an extension that is not available through the webstore because it's marked as private and is still pending review. However, I see the weekly users count increasing. When the counter was at 1, I thought it was somehow tracking my own usage of the locally...

Chrome extension options

javascript,google-chrome,google-chrome-extension,options
In the manifest.json of my extension, I added this: "options_ui": { "page": "options.html", "chrome_style": true }, My options page (options.html) has this right before the closing body tag: <script src="options.js"></script> Both options.html and options.js are in the same folder. options.js starts with this: console.log('options.js'); Problem: I am loading the unpacked...

Is there a way to launch chrome packaged app from chrome extension

google-chrome,google-chrome-extension,google-chrome-app
I'm developing a chrome packaged app and chrome extension, both of them communicate with one another, and i want to lunch my packaged app from a chrome extension, is there any way to do it? Note: I've tried using the launchApp method of chrome management api, but for some unknown...

Run a function from injected js

google-chrome-extension
I have been going around in circles with this, so I would appreciate some help This is what I want to achieve User presses my extension ison Popup appears with two buttons, 'run function a' and 'run function b' When they press a button it runs the function in my...

Chrome Extension - How to execute a JS script on page load

javascript,google-chrome,google-chrome-extension,google-chrome-devtools
The following is that I'm trying to achieve Every time 'www.google.com' loads, a script/function triggers. However, the functions itself reloads the page via 'location.reload();' Basically, an infinite loop of reloads. Script reloads page -> Script injected -> Script reloads page -> etc. I want the tab @ google.com to keep...

Popup-script in chrome extension sends messages several times

javascript,google-chrome-extension,content-script
I have my pop-up script for chrome-extension that counts words on the page. So when I click on plugin toolbar icon it starts loading and sends message to the content-script, in return that content-script replies with word-count info on the page. var Popup = (function () { function Popup() {...

Why does chrome.tabs.create create 2 tabs?

google-chrome-extension
When the chrome.tabs.create function is triggered by a message received, it creates 2 tabs. In the following demo code, 1 cat tab is created, and 2 dog tabs are created. Is this by design or is it a bug? If it is a known bug, can you provide the bug...

Can i embed program through native messaging in Chrome (like old npapi plugins)?

google-chrome,google-chrome-extension,npapi,chrome-native-messaging
Is it possible to create Chrome extension which can embed a program into Chrome? I mean something like old NPAPI plugins such as VLC player, java, etc... I found some native messaging examples, but every example is only for sending simple messages to control an external program. But for example...

How to respond to multiple bookmark operations in Chrome?

javascript,google-chrome,asynchronous,google-chrome-extension,bookmarks
I'm working on a simple Chrome extension which deals with bookmarks. So far I've discovered two ways to respond to operations that the chrome.bookmarks API provides: pass callback function directly to the API call (eg. chrome.bookmarks.move(string id, object destination, function callback)) register callback function globally (chrome.bookmarks.onMoved.addListener(function callback)) As far as...

chrome extensions Uncaught ReferenceError: $ is not defined

javascript,jquery,google-chrome,google-chrome-extension
I am trying to make a chrome extension that uses an external javascript file that uses JQuery. But I keep getting this silly error. Screenshot of error in chrome inspector. Any help is appreciated thanks! popup.js $(document).ready(function(){ $.ajax({url: "http://www.google.com", success: function(result){ $("#report-details").html(result); }}); }); popup.html <!doctype html> <html> <head> <title>TEST</title>...

“OAuth2 not granted or revoked” when trying to evalutate free trial in Chrome extension

google-chrome,google-chrome-extension,oauth-2.0
I'm attempting to offer a free trial period for my Chrome extension and have been following the Chrome documentation about how this can be accomplished. When my extension loads, though, the background script is logging the following error to the console: Unchecked runtime.lastError while running identity.getAuthToken: OAuth2 not granted or...

How to tell if a page is loaded as a popup or in a separate tab in chrome extension

google-chrome,google-chrome-extension
My Chrome extension has a page that is seen in a popup or as a separate tab. When it seen as a separate tab, I need to show a small button at the corner of the page. But I couldn't find a way to detect when a page is loaded...

Chrome developer sidebar in extension pane

google-chrome,google-chrome-extension,google-chrome-devtools
I am making a developer extension for Chrome. I create a custom pane, and want to add a sidebar to that pane. This page includes documentation on how to create a sidebar in the Elements pane and the Sources pane. However, it does not include any createSidebarPane method under the...

Using Youtube's Data API

google-chrome-extension,youtube-api,youtube-data-api
I cannot figure out how to use Youtube's API V3, with Chrome's identity extension API. Is there a tutorial somewhere? I would like to start by rating a video.

chrome.extension.getBackgroundPage is undefined in an extension page in an iframe

javascript,google-chrome,google-chrome-extension
I am trying to access my extension's background page using chrome.extension.getBackgroundPage function. However, I get the following error: Uncaught TypeError: chrome.extension.getBackgroundPage is not a function I am calling the function from my bar.js file which is defined as a web_accessible_resource in my manifest.json How do I make it work? manifest.json...

Adding eventListeners to checkboxes in for loop in chrome-extension

javascript,html,google-chrome-extension
I have a function that gets all the tabs in a window and then updates the popup.html page by adding a checkbox for each tab. After doing this there is a second for loop that adds event listeners which update an dictionary containing the value of the checkbox's. The problem...

Is there any way to detect javascript postmessages using chrome extension?

google-chrome-extension,postmessage
Does anybody sees a way to listen to cross iframe/window communication that is being done using the javascript postMessages ? Best would be using the chrome.debugger in the background page of an extension. I see that I can listen to HTTP-Traffic using the "Network.requestWillBeSent" and "Network.responseReceived" events. But I would...

What is the use of different OnBeforeRequestOptions and OnHeadersReceivedOptions?

google-chrome-extension,options,webrequest
From the WebRequest API, I see there are multiple options available as onBeforeRequestOptions Enum "blocking", or "requestBody" OnBeforeSendHeadersOptions Enum "requestHeaders", or "blocking" I understand We need to pass "blocking" when we need to modify the Request in blocking fashion. My question is When do we need the other options ?...

How to set the badge text in a chrome extension from the content script?

google-chrome-extension,content-script
It is possible to set the badge text from a background script. I was wondering if it was possible to do so from a content script.

Jquery auto popup with google chrome extension install check

javascript,jquery,css,google-chrome,google-chrome-extension
I want to make an auto popup in my website with jquery working only at Google Chrome and it will be like this : if you use Google Chrome to surf my website and you don't install my Google Chrome extension the popup will show with a button to install...

My Chrome Extension Keeps Saying Its Corrupted

google-chrome,google-chrome-extension
I recently got a Chrome Developer account, i paid the 5 bucks and stuff. I published my extension after extensive testing and it works perfectly, but after i uploaded the app and then downloaded it to test it, whenever i try to open it, it disappears from my chrome bar...

What is “platforms” for in manifest.json?

google-chrome-extension,google-chrome-app
In manifest.json definition, there is a "platforms" key. However, I cannot find it documented anywhere. What does it do?...

Opening a Chrome extension as a pop-up using a link

google-chrome-extension
I have a chrome extension installed in my browser. When I click the extension's icon in the menu bar the extension opens as a floating pop-up, as expected. What I am trying to do is to open the extension in Chrome via a link/shortcut/whatever from another program. As a first...

Meta tags in chrome extension manifest.json?

google-chrome-extension
I'll give a contrived example: Imagine that I wanted to list my Chrome extension on the Chrome Web Store under the title "Brad's Animal Names Extension" but I also wanted my extension to be revealed in the search results for "elephant". Is there any way I can do this without...

Is it possible to use (or include) node.js framework in a Google Chrome Extension?

javascript,node.js,google-chrome,google-chrome-extension,socket.io
I don't want to create a chrome extension ONLY using node.js. I know chrome extensions use HTML, CSS and JavaScript. But I want to make a chat application as a chrome extension. I found that using MEAN stack along with socket.io for a chat application is the latest way and...

Event for Chrome Google account logout or Google account user switch

javascript,google-chrome-extension,oauth-2.0,google-account
Is there an event or listener that fires when a user logs his Google account out of Chrome (or switches from account)? When this happens I want to change my Chrome Extension default_icon (from green to red)....

background to content script messaging: message sent before content script is ready

javascript,google-chrome,google-chrome-extension,messaging
When trying to pass a message from the background script to the content script, I'm using chrome.tabs.query( {active: true, currentWindow: true}, function(tabs) { chrome.tabs.sendMessage( tabs[0].id, {greeting: "hello"}, function(response) { console.log(response.farewell); } ); }); in the background script and the corresponding listener chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { if (request.greeting === "hello")...

How to access the DevTools API without actually opening the DevTools window?

google-chrome-extension,google-chrome-devtools
The documentation says "An instance of the extension's DevTools page is created each time a DevTools window opens. The DevTools page exists for the lifetime of the DevTools window." However, the Facebook Pixel Helper manages to to get network information without the devtools window being open. So, I was wondering...

Host my own chrome extension in my website

google-chrome-extension
I have developed one chrome extension and i want to use it on some windows pc's all over the world (of course the owners know me and my work) but i dont want to upload it on WEBSTORE since its only for something we use for ourselfs. Could i host...

chrome extension icon is not changing

jquery,google-chrome,google-chrome-extension
I have developed a simple Chrome Extension for changing the extension icon every 300 milliseconds. But my code is not working. Below is my code: setTimeout(updateIcon, 300); var min = 1; var max = 5; var current = min; function updateIcon() { chrome.browserAction.setIcon({path:"icon" + current + ".png"}); current++; if (current...

What is the name of the language in which the main program of Chromium is written?

google-chrome-extension
We would like to develop a new plugin for Chromium. To achieve this goal, we must learn at least one computer language. We do not know its / their name(s). Do you know the name of the computer language in which is written the program contains 1) the variable whose...

Chrome Context menu is generating incorrect link

javascript,google-chrome,url,google-chrome-extension,contextmenu
I have written a context menu code similar to Google's Search in Google for '...' The code is working fine up to showing menu option and clicking. After selecting the menu option, new tab is created but Chrome tries to load chrome-extension://acpffpbkehpfofhgilcophibgbkhmmba/https://www.google.co.in/search?q=Wikipedia instead of https://www.google.co.in/search?q=Wikipedia. Please suggest what could be...

update popup.html content dynamically

javascript,google-chrome-extension,popup,google-chrome-devtools
I am sending a message from the contentscript to popup and trying to show the received message when the extension is clicked. I can see that the message is being received only when I Inspect popup contentscript.js console.log("content script"); chrome.runtime.sendMessage("hello",function(response) { console.log("sending message"); }); popup.js console.log("popup script"); function onReq(request, sender,...

I added a new chrome extension but the icon not appearing on right of address bar.

google-chrome,google-chrome-extension,icons
Im just a user and I added a new extension, Peerio, to chrome and it installed but no icon to the right of address bas as supposed to be. I checked the settings ->extensions and i see its installed, but can't us it. Actually out of about 8 extensions i...

Composing email(gmail) from chrome extension

javascript,email,google-chrome-extension
I am trying to develop a chrome extension which basically has a button , on click which opens the Gmail compose mail popup, with subject/body filled with static text content everytime. I tried reading Gmail APIs, but couldn't get far. If anyone has worked on any such thing, please guide...

Chrome extension, custom context menu item not showing [duplicate]

google-chrome-extension
This question already has an answer here: Chrome extension context menu not showing up 1 answer I know this question has been asked so many times on this site, e.g. this post. However, Chrome upgrades so fast and it seems those solutions don't work for the latest version anymore....

Chome extension message between users

node.js,google-chrome-extension,google-chrome-app,p2p,chrome-gcm
Is it possible to send messages between users directly without a server in chrome extensions? (P2P) Or required server (NodeJS example)? Maybe use Google Cloud Messaging, i not understand logic and work (official example extension)...

How to select Chrome extensions to enable when using Selenium [duplicate]

python,selenium,google-chrome-extension,webdriver,web-testing
This question already has an answer here: Using Extensions with Selenium (Python) 1 answer I am using Selenium web driver to develop an automated test using Chrome as my browser. I am using Python for this. I have an extension on my Chrome browser that I would like enabled...

JS blocked in Google Chrome by extension [closed]

javascript,google-chrome,google-chrome-extension
While browsing a site (facebook to be specific), JS was automatically blocked. And while checking JS content setting, there was entry for facebook to block JS and it was done by extension, as shown in attached image. I tried to add new entry to allow JS hoping it will override...

Can Chrome extension content script access all tabs?

google-chrome,google-chrome-extension,content-script
Basically, I want to get all the opened tabs of the browser window, from within a tab, more specifically, in content script. I tried chrome.tabs.query, it works in background script, but doesn't work in content script. So my questions are: Is there a way to do such work? Maybe an...

Displaying chrome://favicon/ on newtab page

google-chrome,google-chrome-extension
I'm developing a Google Chrome extension where bookmarks are displayed on the newtab page. Everything works fine so far except for the favicons. Entering this URL in Chrome displays the favicon of a page: chrome://favicon/http://stackoverflow.com/ However, in the newtab, which I properly set up, they don't get displayed. The HTML...

How to find a dynamically added array element in a function

javascript,jquery,html,arrays,google-chrome-extension
So basically I'm adding an element to an array and then creating a block of text for that element. The problem is I keep getting undefined as the result of calling that element in a function I created to set the block text to the dynamically added element text. When...

How to make function in loop run synchronously?

javascript,jquery,loops,google-chrome-extension,synchronization
Am working on a chrome plugin, and need to sendMessage from an 'app page' to a 'content script' and then get the return messages, from inside a loop. But since the loop doesn't wait for the sendMessage to return a value before starting on the next iteration, it is screwing...

Chrome Extension Cannot Read Property create of undefined in contextMenus.create

javascript,google-chrome-extension
This is my contextMenus.create function which is throwing the cannot read property of create in undefined error. chrome.contextMenus.create({ "title": "Buzz This", "contexts": ["page", "selection", "image", "link"], "onclick" : clickHandler }); I also have this in the same content script: chrome.contextMenus.onClicked.addListener(onClickHandler); // The onClicked callback function. function onClickHandler(info, tab) { window.alert(info.srcUrl);...

Chrome Extension : How to intercept requested urls? [closed]

google-chrome,http,google-chrome-extension
How can an extension intercept any requested URL to block it if some condition matches? Similar question for Firefox. What permission needs to be set in manifest.json?...

How to run chrome js snippet before other js files?

javascript,google-chrome,google-chrome-extension
Create chrome snippet like this: window.my_property = "my_property"; Open any site Run the snippet I want to my snippet run before other js scripts on the website. Is it possible? Thanks in advance....

Script tags don't work in Chrome Dev Editor

javascript,google-chrome-extension,chrome-dev-editor
I'm using the Chrome App "Chrome Dev Editor" to make an Extension, but for some reason the script tags (which are in body tags) don't seem to work. I have tried to take the code and put it in codepen.io (an online HTML/CSS/JS editor and it seems to work fine...

can “default_popup” (in manifest.json field) have full file path?

google-chrome-extension
Im writing chrome extension and I want to use a *.html file as default_popup. the file is located outside my project folder. I want to write something like: ... "browser_action": { "default_icon": "icon.png", "default_popup": "..\MembershipApp_v2\build\web\index.html" }, ... but the chrome replies: Failed to load extension from: ~\Desktop\6_5_15\plugin_proj Manifest is not...

Can I write a chrome extension to change the CSS of a page or site as the page loads?

javascript,css,google-chrome,google-chrome-extension,browser-plugin
In GitHub, I cannot stand how the side menu is located on the right side when you are in a repository. It drives me nuts, so I want to script something that will change the float:right property on the side menu to float:left. A buddy of mine suggested I write...

JQuery .find() failing on an .ajax() result

jquery,html,ajax,google-chrome-extension,jquery-selectors
I'm working on a Chrome extension which, under certain conditions, performs a $.ajax() request and then uses information of specific elements in the returned HTML. For now, I'm simply trying to have it access the specific element and log it to the console to ensure it works correctly. To start,...

Looking for tool that prevent script to become unresponsive [on hold]

javascript,browser,google-chrome-extension
For a side project I need to generate a lot of data from a WebGL Application. This Web App is mostly a personal tool and I really don't care if my browser become unresponsive (I mean, I know it will). Does someone know a browser/tool/plugin that could allow me to...

How to get chrome extension ID in dev and production?

google-chrome-extension
I work on a chrome extension. I do use some messages between my web page and background process. Problem is: the ID of my application is different when it comes from the google extension page and the one I locally work on and debugging. Is there a way to make...

Accessing Search Query Text in Google Chrome Browser with Chrome Extension

javascript,google-chrome,google-chrome-extension
I'm building a Chrome extension for myself. I want to access my search bar so that I can feed my queries into my own private ingest server (for realtime processing). How does one access text entered into the search bar in Chrome? I started here https://developer.chrome.com/extensions/devguide but it's unclear where...

How to use external ajax response in Chrome Plugin

javascript,jquery,ajax,google-chrome-extension
I have a existing file ajax,js in my website that makes an ajax request and creates a global JSON object, searchResult using that response. Now I am creating a Chrome plugin, that requires this JSON Object inside it. I have a content script for the plugin viz. plugin.js and I...

Are there any Chrome-specific techniques to scope/isolate CSS?

css,google-chrome,google-chrome-extension,polymer,shadow-dom
I'm writing a Chrome extension that injects HTML into a displayed page. I want the injected HTML to have it's own style, protected from the CSS that may be present in the host page. I've tried using conventional CSS, and still suffer from style corruption from the host page. After...

jQuery not working in background.js of chrome extension

javascript,jquery,google-chrome,google-chrome-extension
I am making a chrome extension. Here is my manifest: { "manifest_version": 2, "name": "ROBLOX-R", "version": "1", "description": "An extension to automatically trade currencies.", "browser_action": { "default_icon": "icon.png", "default_popup": "popup.html" }, "permissions": [ "<all_urls>" ], "content_scripts": [{ "matches": ["<all_urls>"], "js": [ "jquery.min.js" ] }], "background": { "scripts": ["background.js"] } }...

contentScript having CORS issue with $.ajax()

javascript,jquery,ajax,google-chrome,google-chrome-extension
I got this error expecting $.ajax() to work in my contentScript XMLHttpRequest cannot load http://example.com/tab/index.php. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'chrome-extension://gncbffieahbpgabchdjmhipkmahk****' is therefore not allowed access. This is how the ajax look like in my contentscript.js $.ajax({type: "GET",url: "http://example.com/tab/index.php", success: function(data){ alert(data); }}); and in...

Chrome Extension Script not Working

javascript,html,google-chrome-extension
I am extremely new to creating extensions for chrome, and right now I'm just trying to mess around and create a simple canvas that you can open up and draw on. When I load popup.html as a normal webpage everything seems to work just fine, but when I open the...