google-chrome-extension

How to detect network state changes in a Chrome extension

巧了我就是萌 提交于 2019-12-24 07:49:13
问题 I'm writing a simple Chrome extension, the behavior is needed to detect if device is connect to the Internet. I'm currently trying to connect to ping service for checking network status and it is not efficient. Is there any event to which I can listen from Chrome JavaScript API? 回答1: There is no specific event in the Chrome extension APIs intended to be used for this purpose. In "How to detect online/offline event cross-browser?" it is suggested that you can use window.navigator.onLine and

Manifest file is invalid

做~自己de王妃 提交于 2019-12-24 07:04:46
问题 I successfully uploaded a new version of my extension to the chrome app store, and I'm suddenly getting Manifest file is invalid errors when I try to install it. Here is the source code (specifically, I tried to upload this package). How do I fix it? The one thing I tried to change is make the extensino's icon disappear, according to this answer. I tried several things like not using a browser_action or using a page_action instead ... but I keep getting an error when I try to install the

Chrome extension — will my source code be available to users?

谁说我不能喝 提交于 2019-12-24 06:55:07
问题 I'm about to release my first chrome extension to chrome web store. They want the code to be zipped and uploaded. And once through approval it will be available to users as .crx files, if I understand it correctly. But these crx files are simple zip file with .crx extension right? If so, won't users be able to get hold of the source code? Which means, I may get to see 100 more versions of my source code floating around the web store alongside my extension. :( Is there anyway to prevent the

Javascript match URL with wildcards - Chrome Extension

独自空忆成欢 提交于 2019-12-24 06:47:38
问题 I'm writing a chrome extension which allows the user to modify content on specific websites. I'd like the user to be able to specify these websites using wildcards, for example http://*.google.com or http://google.com/* I found the following code currentUrl = "http://google.com/"; matchUrl = "http://*.google.com/*"; match = RegExp(matchUrl.replace(/\*/g, "[^]*")).test(currentUrl); But there are a few problems with it. http://test.google.com/ is a match http://google.com/ is not a match http:/

How to get chrome extension name and status by using extension Id in C#

假装没事ソ 提交于 2019-12-24 06:27:12
问题 I have a chrome extension Id which I am getting from Registry ( \Software\Google\Chrome\Extensions\{exID} ). I want to get the Extension name by using that Id. How to get that? I checked "Preference" file also but didn't get the relevant info in that. I am doing this in WPF and C# so I am trying to avoid Javascript here. 回答1: I'm currently looking at the Secure Preferences file in the profile folder, and it contains all the data you need. Google moved the extension data there and protected it

Click on elements in Chrome Extension with selenium

爱⌒轻易说出口 提交于 2019-12-24 05:58:05
问题 I have been searching on the internet using Selenium (Java) interacting with Google Chrome Extension but have not been able to find an answer. First Question Is there a way to launch the chrome extension since Selenium only interact with WebView but not on the chrome extensions button in the browser ? I try this method "chrome-extension://id/index.html" but the extension did not launch as expected. I like find if there is another way to launch a chrome extension through selenium Second

Click on elements in Chrome Extension with selenium

岁酱吖の 提交于 2019-12-24 05:58:04
问题 I have been searching on the internet using Selenium (Java) interacting with Google Chrome Extension but have not been able to find an answer. First Question Is there a way to launch the chrome extension since Selenium only interact with WebView but not on the chrome extensions button in the browser ? I try this method "chrome-extension://id/index.html" but the extension did not launch as expected. I like find if there is another way to launch a chrome extension through selenium Second

How do I get a new Access Token before its expiration after user login with chrome.identity.launchWebAuthFlow?

白昼怎懂夜的黑 提交于 2019-12-24 05:54:13
问题 Sorry if this have been asked before but I've spend the whole day googling without any results. I'm using Chrome Identity API for a Chrome Extension I'm building for my work (interacting with Google Sheets API), and I'm looking to persist the login for the user but refresh tokens with this API are nowhere to be found. I first implemented chrome.identity.getAuthToken() and I was able to authorize the request to gSheets API, the problem came when the Access Token expired. I'm aware that calling

How do I get a new Access Token before its expiration after user login with chrome.identity.launchWebAuthFlow?

寵の児 提交于 2019-12-24 05:54:08
问题 Sorry if this have been asked before but I've spend the whole day googling without any results. I'm using Chrome Identity API for a Chrome Extension I'm building for my work (interacting with Google Sheets API), and I'm looking to persist the login for the user but refresh tokens with this API are nowhere to be found. I first implemented chrome.identity.getAuthToken() and I was able to authorize the request to gSheets API, the problem came when the Access Token expired. I'm aware that calling

Google JavaScript API - chrome.printerProvider

做~自己de王妃 提交于 2019-12-24 05:16:26
问题 I'm trying to make a printing extension, that can configure printing options and send a print job to the attached printers. I have made sample extensions other than printing, but the printing API has no methods, just events, so it's not working for me. Here is my script (Event.js): chrome.printerProvider.onPrintRequested.addListener( function( printJob, callback){ var str = printJob.printerId + " , " + printJob.title ; alert('str: '+ str); console.log('str: '+str); appendToLog('str: '+ str );