google-chrome-extension

Running Selenium WebDriver using Python with extensions (.crx files)

人盡茶涼 提交于 2019-12-28 05:55:13
问题 I went to Chrome Extension Downloader to snag the .crx file for 'Adblock-Plus_v1.4.1'. I threw it in the directory I'm working in, and then ran: from selenium import webdriver chop = webdriver.ChromeOptions() chop.add_extension('Adblock-Plus_v1.4.1.crx') driver = webdriver.Chrome(chrome_options = chop) It totally acknowledges that it exists, but it gives me what looks like a ChromeDriver.exe style message: ERROR:extension_error_reporter.cc(56)] Extension error: Package is invalid: 'CRX_PUBLIC

Running Selenium WebDriver using Python with extensions (.crx files)

ぐ巨炮叔叔 提交于 2019-12-28 05:54:21
问题 I went to Chrome Extension Downloader to snag the .crx file for 'Adblock-Plus_v1.4.1'. I threw it in the directory I'm working in, and then ran: from selenium import webdriver chop = webdriver.ChromeOptions() chop.add_extension('Adblock-Plus_v1.4.1.crx') driver = webdriver.Chrome(chrome_options = chop) It totally acknowledges that it exists, but it gives me what looks like a ChromeDriver.exe style message: ERROR:extension_error_reporter.cc(56)] Extension error: Package is invalid: 'CRX_PUBLIC

Running Selenium WebDriver using Python with extensions (.crx files)

走远了吗. 提交于 2019-12-28 05:54:03
问题 I went to Chrome Extension Downloader to snag the .crx file for 'Adblock-Plus_v1.4.1'. I threw it in the directory I'm working in, and then ran: from selenium import webdriver chop = webdriver.ChromeOptions() chop.add_extension('Adblock-Plus_v1.4.1.crx') driver = webdriver.Chrome(chrome_options = chop) It totally acknowledges that it exists, but it gives me what looks like a ChromeDriver.exe style message: ERROR:extension_error_reporter.cc(56)] Extension error: Package is invalid: 'CRX_PUBLIC

How to inject CSS into webpage through Chrome extension?

假如想象 提交于 2019-12-28 04:53:07
问题 I do not know how to inject CSS into a webpage through a Chrome extension. I am trying to inject this into a web page: body { background: #000 !important; } a { color: #777 !important; } Here is my manifest.json: { "update_url":"http://clients2.google.com/service/update2/crx", "name": "Test Extension", "version": "1.0", "description": "This is a test extension for Google Chrome.", "icons": { "16": "icon16.png", "48": "icon48.png", "128": "icon128.png" }, "background_page": "background.html",

Get URL and save it | Chrome Extension

一曲冷凌霜 提交于 2019-12-28 04:49:36
问题 Basically on my window (when you click the icon) it should open and show the URL of the tab and next to it I want it to say "Save", it will save it to the localStorage, and to be displayed below into the saved links area. Like this: Something like bookmarks :) 回答1: If you want to do something like that, you easily do that with the Chrome extensions API. The areas to look for are: Chrome Extension Tab API Chrome Extension Browser Action API HTML5 localStorage or HTML5 webdatabase Now the first

How to modify current url location in chrome via extensions

南楼画角 提交于 2019-12-28 04:49:19
问题 I want to create an extension that redirects the user to another website if he clicks on the extension button. So far I have only seen extensions which create a new tab for each click. Is it possible to redirect the user to another website using the active tab? I tried something like this: chrome.browserAction.onClicked.addListener(function(tab) { var url = "https://www.mipanga.com/Content/Submit?url=" + encodeURIComponent(tab.url) + "&title=" + encodeURIComponent(tab.title); document

Replace each word in webpage's paragraphs with a button containing that text

情到浓时终转凉″ 提交于 2019-12-28 04:35:13
问题 I'm working on a Google Chrome extension that takes all the paragraphs (p tag content) and places each words in them up into a button. It's a part of a larger program I'm working on. I have a working copy of that part of the app on JSFiddle. Now, I'm trying to port that code into a Chrome Extension. But, I'm having trouble accessing the DOM from my background script, so that I can manipulate it with my code (in my function FormatText() ). I haven't even called the function yet, because I can

Chrome showing error as: Refused to execute inline script because of Content-Security-Policy

假如想象 提交于 2019-12-28 02:58:26
问题 I am working on creating a Chrome Extension of an Image Cropping Widget. The code of my popup.html is as follows: <body> <textarea id="widget_script" style="border:1px solid #ccc;padding:5px;width:600px" rows="5" readonly></textarea> <script type="text/javascript"> var protocol=window.location.protocol; var host= window.location.host; var head=('<div id="wd_id" style="margin-bottom: 20px;"></div> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></\script>

chrome.storage.local.set using a variable key name

吃可爱长大的小学妹 提交于 2019-12-28 01:55:47
问题 In a Google Chrome Extension, I want to use chrome.storage.local (as opposed to localStorage) because: With key-value pairs, the value can be any object (as opposed to string only) Changes to the data model using setter storage.set can trigger an event listener Using storage.set , how can I have a variable key name? Note: If I don't use the setter, I can do storage[v1] , but changes to the object won't trigger the event listener. var storage = chrome.storage.local; var v1 = 'k1'; storage.set(

Chrome extension content script re-injection after upgrade or install

守給你的承諾、 提交于 2019-12-28 01:43:54
问题 After the Chrome extension I'm working on is installed, or upgraded, the content scripts (specified in the manifest) are not re-injected so a page refresh is required to make the extension work. Is there a way to force the scripts to be injected again? I believe I could inject them again programmatically by removing them from the manifest and then handling which pages to inject in the background page, but this is not a good solution. I don't want to automatically refresh the user's tabs