google-chrome-extension

How to fix chrome-extension inline JavaScript invocation error?

别来无恙 提交于 2019-12-17 16:03:38
问题 I'm making a chrome extension however I seem to get the following error when I try to fire up an onclick() event. Refused to load the script 'https://apis.google.com/js/client.js?onload=handleClientLoad' because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:" and Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome

Chrome Console SameSite Cookie Attribute Warning

試著忘記壹切 提交于 2019-12-17 16:01:50
问题 Is anybody else getting this Chrome console warning? A cookie associated with a cross-site resource at was set without the SameSite attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with SameSite=None and Secure . You can review cookies in developer tools under Application>Storage>Cookies and see more details at and . In Chrome Flags chrome://flags/ I've tried disabling both: SameSite by default cookies Cookies without SameSite must be

Port error: Could not establish connection. Receiving end does not exist. In Chromiume

我的梦境 提交于 2019-12-17 15:59:24
问题 I'm developing an extension in Chrome, and there's a problem. In my inject.js , I make a request like: chrome.extension.sendRequest({command:'skip'},callback) and in my `background.js I simply add a request Listener like: chrome.extension.onrequest.addListener(function(req,sender,res){console.log("procession"}) But there's an error: Port error: Could not establish connection. Receiving end does not exist It seems a bug in chrome? PS: part of my manifest.json "background": { "scripts": [

Access Local Files using a Google Chrome Extension

三世轮回 提交于 2019-12-17 15:39:59
问题 I have asked a similar question to this previously Communicate with Cash Drawer from Website However the question was very vague and I now know what I require is possible using an extension. This question is similar to the following, however, not quite the information I need. Chrome extension and local storage Access local files through Google chrome extension? List a local directory with chrome extension What I effectively need to do is run a bat file on the users computer from my website.

Inject javascript in an iframe using chrome extension

坚强是说给别人听的谎言 提交于 2019-12-17 15:35:04
问题 There are lots of questions/answers on injecting javascript into the document page. What I really want to do is inject javascript in an iframe within the document. To be clear, that iframe doesn't belong to the same domain as the document. I've already tried it through console (not through extension) but was unable to do so. I'm very curious if this is something that can be done using a chrome-extension ? 回答1: Yes, you can use content_scripts property in manifest.json like this: "content

How to build an chrome extension like Google Hangouts

让人想犯罪 __ 提交于 2019-12-17 15:34:52
问题 The Google Hangouts extension has a panel that shows up outside of the Chrome UI. It is sort of like a notification but not. I don't see anything in the Extension Developer Docs that describes an API to make this work. Is this a Google-specific hack they're doing? Is there something in the experimental APIs that I'm missing? 回答1: It is an options of chrome.windows.create. Make sure you set type to panel . chrome.windows.create({ url: 'https://mobile.twitter.com/', type: 'panel' }); panel may

Chrome extension: sendMessage from background to content script doesn't work

倾然丶 夕夏残阳落幕 提交于 2019-12-17 15:34:32
问题 I know that question has been repeatedly asked in different ways, but I tried to go through all the answers (hopefully I didn't miss anyone) and none of them worked for me. Here is my extension's code: manifest: { "name": "test", "version": "1.1", "background": { "scripts": ["contextMenus.js"] }, "permissions": ["tabs", "<all_urls>", "contextMenus"], "content_scripts" : [ { "matches" : [ "http://*/*" ], "js": ["jquery-1.8.3.js", "jquery-ui.js"], "css": [ "jquery-ui.css" ], "js": ["openDialog

Chrome Extension - How to get HTTP Response Body?

与世无争的帅哥 提交于 2019-12-17 15:33:38
问题 It seems to be difficult problem (or impossible??). I want to get and read HTTP Response, caused by HTTP Request in browser, under watching Chrome Extension background script. We can get HTTP Request Body in this way chrome.webRequest.onBeforeRequest.addListener(function(data){ // data contains request_body },{'urls':[]},['requestBody']); I also checked these stackoverflows Chrome extensions - Other ways to read response bodies than chrome.devtools.network? Chrome extension to read HTTP

Replace text with link with chrome extension

会有一股神秘感。 提交于 2019-12-17 14:58:30
问题 I am trying to replace text on a webpage with links. When I try this it just replaces the text with the tag and not a link. For example this code will replace "river" with: <a href="http://www.cnn.com">asdf</a> This is what I have so far: function handleText(textNode) { var v = textNode.nodeValue; v = v.replace(/\briver\b/g, '<a href="http://www.cnn.com">asdf</a>'); textNode.nodeValue = v; } 回答1: If all you wanted to do was change the text to other plain text, then you could change the

List file sizes of all images on a page (Chrome Extension)

北战南征 提交于 2019-12-17 14:29:28
问题 I want to write a Chrome Extension where you enter a page URL and it lists all the image filenames that appear on that page with the file sizes of those images e.g. "Page contains images: 1.jpg (65KB), 2.png (135KB)". How can this be done? I want to avoid making this a devtools extension as well. I've tried using the webRequest API but I can see no way to access the body of the requests. The image size might be sent in the response header but this isn't guaranteed. I've tried using AJAX to