google-chrome-extension

Chrome extension in python?

£可爱£侵袭症+ 提交于 2020-01-09 04:38:35
问题 I would like to create a google chrome extension. Specifically, I'd like to make a packaged app, but not a hosted app. Am I correct in thinking this limits me to JavaScript (and HTML/CSS)? My problem is that I need to do some complex math (singular value decomposition, factor analysis) and I don't want to write algorithms for this in javascript. Python already has libraries for the functions I need (SciPy), but I can't find any indication that I can make a Chrome extension using python. Is

Establish a communication link between content script and background page

陌路散爱 提交于 2020-01-07 06:47:30
问题 Developing a chrome extension using javascript is one of my university projects. I don't know how to establish a communication link between content script and background page using messaging. I need some help in this establishing the connection background.html chrome.tabs.getSelected(null, function(tab) { chrome.tabs.sendRequest(tab.id, {method: "getHTML"}, function(response) { console.log(response.data); }); }); content_script.js chrome.extension.onRequest.addListener(function(request,

Chrome extensions : cannot get back my stored datas

你离开我真会死。 提交于 2020-01-07 06:15:10
问题 I try to save datas from my chrome extension : chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { chrome.storage.sync.set(request, function() { chrome.storage.sync.get(null, function(datas) { console.log(datas); console.log("background"); sendResponse(datas); }) }); } ); Each time I'm receiving a message, I store this message, and I send all saved item as a response. In this code, in the console, background is displayed but datas is empty (Nothing in the console)

WebRTC issue in chrome 59

£可爱£侵袭症+ 提交于 2020-01-07 05:46:48
问题 After updating chrome to version 59 the getUserMedia for screen sharing is fail with " NavigatorUserMediaError TrackStartError ". This error happen only if two monitors attached to my laptop, if i using laptop screen only, the WebRTC screen sharing works and getUserMedia returns stream as well (This is regrassion from chrome 58). The mediaConstraints for getUserMedia is { audio: false, video: { mandatory: { chromeMediaSource: 'desktop', chromeMediaSourceId: 'the id returned by chrome

chrome extension: Injecting code which references a script that I am also injecting - why it fails?

孤人 提交于 2020-01-07 04:37:19
问题 I am trying to create a jquery popup on any page, triggered on demand, when the user presses on my chrome extension. I have permissions set to [ "tabs", "http:// / ", "https:// / " ] I have a background page which tries to do the following: chrome.browserAction.onClicked.addListener(function(tab) { //chrome.tabs.executeScript(null, { code: "alert(document.title);" }, null); chrome.tabs.executeScript(null, {file: "demo.js"}, null); chrome.tabs.executeScript(null, { code: "document.body

How to write a Google Chrome extension that disables a default keyboard-shortcut?

为君一笑 提交于 2020-01-07 04:01:31
问题 I need a Google Chrome extension that simply disables the built in alt e shortcut and pass it to the HTML accesskey as ordinary. (yes, that all - no configuration/graphics) It's for an in-house web-application and I don't want to use existing extensions. I've browsed the extension documentation but would be thankful for a jump start in this matter. 回答1: Unfortunately there's no way to hook into global hotkeys. The best you can do is add a window event keypress listener. Source: a Chromium

Send message to background page, update the html, and then show it in a tab

≯℡__Kan透↙ 提交于 2020-01-07 02:24:08
问题 I have a chrome extension where a user inputs some information and it generates a report. Now of course, this report will be different each time based on what the user has entered. What I want to achieve, is for my extension to say: Hey, Mr. Background page. Here's the information you need, now build some html based off what I've given you and show it to the user. Here is the manifest.json that I'm using: { "manifest_version": 2, "name": "XXXX", "description": "XXXX", "version": "1.0.0",

Send message to background page, update the html, and then show it in a tab

浪尽此生 提交于 2020-01-07 02:24:08
问题 I have a chrome extension where a user inputs some information and it generates a report. Now of course, this report will be different each time based on what the user has entered. What I want to achieve, is for my extension to say: Hey, Mr. Background page. Here's the information you need, now build some html based off what I've given you and show it to the user. Here is the manifest.json that I'm using: { "manifest_version": 2, "name": "XXXX", "description": "XXXX", "version": "1.0.0",

Google Chrome behaves differently when the popup is being inspected

拥有回忆 提交于 2020-01-07 02:23:06
问题 In my attempts to learn how to write Google Chrome extensions I decided to write one where upon clicking a button in the popup the extension opens a new window and opens a new tab for every image on the page. Each tab's url is the src for each image. (I don't think this is particularly useful, I'm doing it merely as an exercise). The weird thing is that it works exactly as I would expect when I have right-clicked on the extension icon and clicked 'inspect popup'. It doesn't work as expected

How can an iFrame that has content, have an undefined contentDocument object?

亡梦爱人 提交于 2020-01-07 02:13:07
问题 I've been trying to develop a browser extension that needs to inject event handlers into all iFrames on a page. I have found that some iFrames, like those used for the Disqus commenting system, have content but no contentDocument. How is this possible, and how can I access the event handlers for an iframe without a contentDocument? Check out the comment section at the bottom of this page for an example. If you inspect the comment text area, you will see it is in an iFrame that has no