google-chrome-extension

Get button clicked with chrome extension

折月煮酒 提交于 2019-12-13 02:49:13
问题 I want to know how to detect if a button with a certain id is clicked on a webpage with my chrome extension. With my code I have an error saying that my element is undefined. Here is my manifest : { "manifest_version": 2, "name": "app", "description": "my app", "version": "1.0", "browser_action": { "default_icon": "icon.png", "default_popup": "popup.html", "default_title": "Changer le background" }, "permissions": [ "activeTab", "storage" ] } And my popup.js file : document.addEventListener(

Install/Add chrome extension from Chrome Web Store using Selenium

跟風遠走 提交于 2019-12-13 02:36:31
问题 I am developing test automation using Selenium with Java. I would like to install/add extension to chrome instance launched through Selenium. One way to install/add extension is using .crx file as follow. ChromeOptions options = new ChromeOptions(); options.addExtensions(new File(ext_path)); DesiredCapabilities capabilities = DesiredCapabilities.chrome(); capabilities.setCapability(ChromeOptions.CAPABILITY, options); driver = new ChromeDriver(capabilities); But I would like to install/add

Callback not called for chrome.identity.getAuthToken for self hosted chrome extension

て烟熏妆下的殇ゞ 提交于 2019-12-13 02:35:38
问题 I am developing a self hosted chrome extension and have generated the key and client_id as described here. My call to getAuthToken is (copied from the answer to this question) chrome.identity.getAuthToken({ interactive: true }, function(token) { if (chrome.runtime.lastError) { alert(chrome.runtime.lastError.message); return; } var x = new XMLHttpRequest(); x.open('GET', 'https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=' + token); x.onload = function() { alert(x.response);

Chrome Extension to Redirect to URL with Parameter

我的梦境 提交于 2019-12-13 02:09:50
问题 I'm attempting to create a Chrome extension which will add a parameter to the end of a URL if the URL matches a given pattern ( *://*.mydomain.com/s/* ). Below is the manifest file and background script I have, but I cannot get it working. What am I doing wrong? manifest.json: { "manifest_version": 2, "name": "Search Grid View", "version": "0.1", "description": "Changes MyDomain.com search to grid view by default", "background": { "scripts": ["background.js"] }, "permissions": [ "tabs",

Dialog with permissions language on Chrome extension update

↘锁芯ラ 提交于 2019-12-13 02:01:22
问题 I know that in the case when some extension is updated and requires additional permissions compared to a previously installed version, a dialog with the permission warnings will be shown. My question is: is any dialog is going to be shown if some permissions are removed compared to the previous extension version? 回答1: is any dialog is going to be shown if some permissions is cutted off comparing with the previous extension version? If your permissions decrease, no dialog will be shown.

How to set document of jQuery

☆樱花仙子☆ 提交于 2019-12-13 01:57:16
问题 Changing a document, jQuery working with, is very important in Firefox/Chrome extension developing. It needs to use $(...) or jQuery(...) call . Now I forced to use jQuery this way: var jQDoc = jQuery(content.document); var someElements = jQDoc.find('.some-selector'); I wanna something like this jQuery.setActiveDocument(content.document); var someElements = jQuery('.some-selector'); Is it possible without jQuery code change? Update All what I need: will work with overload of the jQuery(...)

How exactly does a Chrome event page work?

Deadly 提交于 2019-12-13 01:56:53
问题 From developer.chrome.com: Chrome keeps track of events that an app or extension has added listeners for. When it dispatches such an event, the event page is loaded. Conversely, if the app or extension removes all of its listeners for an event by calling removeListener, Chrome will no longer load its event page for that event. Because the listeners themselves only exist in the context of the event page, you must use addListener each time the event page loads; only doing so at runtime

How to identify a tab is reloading, I mean actual page reload

荒凉一梦 提交于 2019-12-13 01:43:49
问题 How to identify a tab is reloading, I mean actual page reload? I see chrome.tabs.onUpdated event , but for this event status is 'loading' even in case of AJAX calls from a webpage. How can I detect a page is getting reloaded ? 回答1: You are right, looks like not possible to recognize AJAX and page reload calls. As workaround you could listen for onunload event for tab webpage. You probably need to check if tabid and url were not changed after that. But do you really need to know if page

Chrome's captureVisibleTab without extension

旧巷老猫 提交于 2019-12-13 01:37:12
问题 I know, that you can do screenshot of website in chrome extensions wit this: chrome.tabs.captureVisibleTab(null, {format: 'png'}, capturedImage); But is this possible with just in javascript? I tried js plugin html2canvas, but these screenshots are terrible. My website is fulled with transitions/animations, 3D transforms... And that html2canvas is unable to make screenshot of that. But I found chrome extension, which makes screenshot of website and that extension has made perfect job. Then I

chrome.runtime.lastError is coming as 'UNDEFINED' despite of fetching an unset variable from chrome local storage,

守給你的承諾、 提交于 2019-12-13 01:28:58
问题 I am trying to check if the key, value pair has been set in the chrome.storage.local. for that i took the help of a similar kind of problem here. Here the variable i'm trying to get from storage has not been set by me. When i try to catch the error using lastError . It is coming as undefined, whereas it was suppose to defined and set due to error in reading a variable that has not been set previously ( as per what i googled). Please help me to detect the error while reading a variable that