google-chrome-extension

selenium webdriver importing Options giving me an ImportError

两盒软妹~` 提交于 2019-12-20 05:18:24
问题 Link to the original code I'm trying to implement into my code. Running Selenium WebDriver using Python with extensions (.crx files) from selenium import webdriver from selenium.webdriver.chrome.options import Options chop = webdriver.ChromeOptions() chop.add_extension('Adblock-Plus_v1.4.1.crx') driver = webdriver.Chrome(chrome_options = chop) I tried incorporating the code, but the 2nd line, from selenium.webdriver.chrome.options import Options is tossing out an error Traceback (most recent

Chrome inject script inconsistency issue

那年仲夏 提交于 2019-12-20 05:11:23
问题 Below function I did was to redirect user to a login page, and then inject a js to login the user. The code below worked well but not consistent, I hardly can debug it because the flow contain refresh of the whole page. in my setLogin.js I try to debug with alert() wrap within $(function(){}); I found that sometime it run sometime it doesn't. So I suspect the script sometime got injected sometime not, but why is it like so? chrome.tabs.update(null, { url: 'https://example.com/index.php?act

Injecting Javascript into Newly Created Tab in Chrome Extension

本秂侑毒 提交于 2019-12-20 04:58:12
问题 I am attempting to make a chrome extension that creates a new tab with a local 'blanksite.html' and injects some javascript code turning it green. Here's what I have so far. background.js chrome.browserAction.onClicked.addListener(function(activeTab){ chrome.tabs.create({'url': chrome.extension.getURL("blanksite.html") }, function(tab) { chrome.tabs.executeScript(tab.id, { code: 'document.body.style.backgroundColor="green"' }); }); }); manifest.json { "manifest_version": 2, "name": "Open

How to specify which content scripts which will run on all_frames and which won't?

我的未来我决定 提交于 2019-12-20 04:51:38
问题 When specifying parameters in the manifest file of a chrome extension there is an option all_frames . This allows the content scripts to be embedded in all frames of a page or not. An example of what I want to achieve is have a.js running with all_frames=false and b.js with all_frames=true . 回答1: The content_scripts manifest property is an array , so you can define multiple content script specification objects: "content_scripts": [ { "matches": ["http://www.google.com/*"], "css": ["mystyles

Sandbox access violation when using tinyeditor wysiwyg editor in chrome extension

耗尽温柔 提交于 2019-12-20 04:38:42
问题 I'm getting the following error when attempting to load a third party wysiwyg editor in a chrome extension. Sandbox access violation: Blocked a frame at "chrome-extension://cmcjindomengjienigbcldekcfnhfped" from accessing a frame at "null". Both frames are sandboxed and lack the "allow-same-origin" flag. I initially got a similar error and managed to resolve it by adding the allow-same-origin flag. This resulted in another error which required the allow scripts flag. Below is the current

Can you rename the “Option” label ? ( Chrome-Extension )

感情迁移 提交于 2019-12-20 04:33:06
问题 I tried this : https://developer.chrome.com/extensions/options.html and made an option page. So a selection has been added under my extension icon with the name of Option . My question is that is there a way to rename Option and change it something like Setting or some words in other languages ? 回答1: The "Options" label at chrome://extensions is automatically adapted to the user's language. Extensions cannot change the value of this label. The value of the "Options" option at the dropdown

Can you rename the “Option” label ? ( Chrome-Extension )

无人久伴 提交于 2019-12-20 04:32:05
问题 I tried this : https://developer.chrome.com/extensions/options.html and made an option page. So a selection has been added under my extension icon with the name of Option . My question is that is there a way to rename Option and change it something like Setting or some words in other languages ? 回答1: The "Options" label at chrome://extensions is automatically adapted to the user's language. Extensions cannot change the value of this label. The value of the "Options" option at the dropdown

Google Chrome extension Content Security Policy

可紊 提交于 2019-12-20 03:21:52
问题 I'm working on a Google Chrome extension that should include Facebook's sdk.js but the problem is I can't make the app work because of the Content Security Policy..Here is part of my code : manifest.json { "manifest_version": 2, "name": "<app-name>", "description": "<description>", "version": "0.1", "permissions": [ "tabs","<all_urls>" ], "content_scripts": [ { "matches": [ "http://*/*", "https://*/*" ], "js": ["intercept_connections.js"] } ], "content_security_policy": "script-src 'self'

Download file in chunks in Chrome Javascript API?

我们两清 提交于 2019-12-20 03:16:55
问题 Does the Chrome Javascript API support downloading a file in several chunks simultaneously? eg in a download manager. 回答1: Short answer: no, no special support. There is a dedicated chrome.downloads API, but it's just the same mechanism as normal Chrome downloads, i.e. single stream. Long answer: You can make it yourself via XMLHttpRequest by setting range attributes, e.g. xhr.setRequestHeader("Range", "bytes=100-200"); See more information here, and potential problems you can run into in

Enable Chrome Extensions in Google Chrome App webview

会有一股神秘感。 提交于 2019-12-20 03:05:36
问题 I'm building a Google Apps Chrome App (not extension but app ) with gmail, calendar, etc. I would like to run extensions from regular chrome in my app. For example, rapportive is a fantastic extension for gmail. But it seems that extensions do not run on pages hosted in a webview . Does anyone have an idea of how enable extensions in chrome apps? 回答1: Extensions in Chrome Apps aren't available by design. A webview is meant to facilitate displaying web-based content that you control, in which