google-chrome-extension

How to debug background/event page suspended state

允我心安 提交于 2019-12-13 01:17:26
问题 I would like to debug what the background script (non persistent) does when it goes to sleep and wakes up (and goes back to sleep again). Clicking on the "background page" will prevent the background script from going into suspended state, but if I kill the page and open it after a while, only fresh logs are displayed, not the ones that were printed before opening the background page (from the extensions page). So I am wondering how do we debug the suspended/wake states of an event page? Edit

Hidden-Field Switcher Icon Button Option

别说谁变了你拦得住时间么 提交于 2019-12-13 00:39:37
问题 I've found this great extension which does exactly what I want in terms of functionality e.g it switches the hidden input fields and makes them visible. The only thing I've been trying to figure out is how to make it so it will work as an extension icon button and not as a shortcut key combination?. Extension: https://chrome.google.com/webstore/detail/hidden-field-switcher/gfkfklknjmlpldiggcjgdgkonoicfngp Thanks My Current Setup: I've been able to add the button but on click it doesn't do

chrome extension and dropbox dropin saver error

大城市里の小女人 提交于 2019-12-13 00:15:02
问题 I'm writing a chrome extension to save images found on a webpage to dropbox. I'm trying to use the dropin saver api to do this, however I am getting an error when the "save to dropbox" link is being clicked. The error I receive is as follows: {"error": "Origin does not match any app domain"} An examination of the GET request reveals the following: GET https://www.dropbox.com/saver?origin=chrome-extension%3A%2F%2Fogmklfknlcgklhfljkcijikghbnghcal&app_key=MYDROPBOXKEY 403 (OK) The error and the

File upload with Javascript in chrome or firefox extension without user intervention

二次信任 提交于 2019-12-13 00:12:52
问题 I've managed to get the element of a button inside a a webpage . I know its ID , its class , etc ; I even managed to trigger the click event from within a content script from a Google Chrome extension . The button is inside a Google webpage. There's a Browse button though that opens up a openDialog window and prompts the user to chose a certain file for uploading. How can I go on automating this upload without prompting the user for the file? I just want to feed it the string from the content

Websockets anomaly in Chrome 19 (latest beta)

﹥>﹥吖頭↗ 提交于 2019-12-13 00:12:48
问题 I've been using websockets without an issue for months to communicate between Chrome and my localhost app. Suddenly, with the latest version of Chrome, data is not going through cleanly. In the Chrome extension's javascript, the relevant part of the code is: window.ws = new WebSocket("ws://localhost:13000/"); window.ws.onopen = function () { window.ws.send('GO'); In my C# app: string msg = ASCIIEncoding.UTF8.GetString(buffer); Debug.WriteLine(msg); For months this worked fine and I would get

Chrome extension: override nonconfigurable properties

你。 提交于 2019-12-13 00:03:36
问题 What's the easiest solution to override nonconfigurable properties? Contentscript Object.defineProperty too can't override nonconfigurable properties. Sample: d=document d.documentElement.appendChild(_=d.createElement('iframe')) Object.defineProperty(_.contentWindow,'top', {configurable:true}) Uncaught TypeError: Cannot redefine property: top at Function.defineProperty () 来源: https://stackoverflow.com/questions/46794470/chrome-extension-override-nonconfigurable-properties

Keep Chrome Packaged App running in background?

青春壹個敷衍的年華 提交于 2019-12-12 22:12:30
问题 I'm trying to build a Chrome app and/or extension to communicate with a serial device (using https://developer.chrome.com/apps/serial), to use for showing data from the device on a webpage. I've created an app that can read messages from my device but I now need to get those messages to my webpage. My plan was to create an extension that communicates with my app and then updates my webpage. My extension sends messages to the app using "chrome.runtime.sendMessage" and my app then responds with

Google Chrome Native Messaging Example returns: Uncaught TypeError: chrome.runtime.connectNative is not a function

自作多情 提交于 2019-12-12 20:50:29
问题 I am trying to get Google's Native Messaging example code to run out of the box. I've downloaded it from here: https://developer.chrome.com/extensions/nativeMessaging#examples I've registered the host. I've installed the extension. I've verified the ID's match. But when I load the "main.html" page & hit the "Connect" button I get: "Uncaught TypeError: chrome.runtime.connectNative is not a function" I'm on Win. 7 x64, Chrome Version 45.0.2454.85 m Any suggestions on what's wrong? 来源: https:/

How to wait for page to finish loading all content before running script or how to best detect major DOM changes

老子叫甜甜 提交于 2019-12-12 19:33:18
问题 I'm making a text replacing extension (of sorts) using the method described here as a basis for replacing text. Here is the important piece of code var elements = document.getElementsByTagName('*'); for (var i = 0; i < elements.length; i++) { var element = elements[i]; for (var j = 0; j < element.childNodes.length; j++) { var node = element.childNodes[j]; if (node.nodeType === 3) { var text = node.nodeValue; var replacedText = text.replace(/[word or phrase to replace here]/gi, '[new word or

How to use tabs.executeScript with react

不打扰是莪最后的温柔 提交于 2019-12-12 19:23:28
问题 In one of my components, when the component is loaded, I want my extension to inject a script into the current tab that the extension is run on. The script essentially gets the source code and save it as a string. So, in my componentWillMount I tried to inject the script in the following way... componentWillMount() { var result = ''; chrome.tabs.executeScript(null, { file: './js/scripts/getPageSource.js' }, function() { // If you try and inject into an extensions page or the webstore/NTP you