google-chrome-extension

Since v38, Chrome extension cannot load from HTTP URLs anymore, workaround?

时光毁灭记忆、已成空白 提交于 2020-01-06 14:37:09
问题 The users of our website run our Chrome plugin which, amongst other things, performs cross-origin requests via XMLHttpRequest as described on the Chrome extension development pages. This has been running just fine for a few years now. However, ever since our users upgraded to the latest version of Chrome (v38), these requests have failed. Our site runs on HTTPS and some of the URLs loaded via our content script are on HTTP. The message is: [blocked] The page at 'https://www.ourpage.com/' was

Javascript does not work in Chrome extensions

守給你的承諾、 提交于 2020-01-06 14:16:01
问题 Inside chrome-extension://<EXTENSION_ID>/hello.html , the following code: <script> alert("hi"); </script> JS does not work? How to make it work? 回答1: You cannot use inline JavaScript in a Chrome extension as per enforced Content Security Policy. You will need to get rid of it, by placing it in an external JS file. 来源: https://stackoverflow.com/questions/23185406/javascript-does-not-work-in-chrome-extensions

jQuery - hide only visible images (before load) on document ready

纵然是瞬间 提交于 2020-01-06 14:04:12
问题 I'm developing a Chrome extension, and require a functionality such that I want to get all visible images as soon as possible (before they load), hide them and set some attribute. I've been trying this: $(document).ready(function () { $('img:visible').each(function() { $(this).css('visibility', 'hidden'); $(this).attr('data-internalid', guid()); }); }); But while debugging, I noticed that it's not even iterating through the loop. What I'm missing here? 回答1: So, as I mentioned in my comments

“Requested device not found” when using chrome.tabCapture.capture

南楼画角 提交于 2020-01-06 14:01:52
问题 Problem I want to capture the audio output of a tab automatically. I'm currently thinking of doing this using Puppeteer (headful), by loading an extension that uses chrome.tabCapture.capture . From my Puppeteer script, I evaluate code within the extensions background.js to get the tab capture started. However, chrome.runtime.lastError.message is set to Requested device not found . The extension works as expected outside of Puppeteer and in a Chrome browser. Any idea why I'm getting Requested

Trying to save and fetch a Javascript object using chrome.storage API?

六眼飞鱼酱① 提交于 2020-01-06 12:27:45
问题 I'm building my first chrome extension and I want it to track the TV series I watch and I'm currently trying to get it to save metadata on the series that I am following. I have a content script that returns the title, the newest episode (and the URL of this episode) as well as the URL of the cover image of the series. I am currently trying to save it with some code on my background script (I have made sure to include "storage" under the permissions section of the manifest file). Since my app

How to dynamically modify the manifest file css file for Chrome Extension, or what is the correct way to toggle a stylesheet on/off?

淺唱寂寞╮ 提交于 2020-01-06 09:31:21
问题 Branching off my Other Question, a user successfully got me to serve a stylesheet but that is the wrong way; it is not what I needed to do. So I have come up with a more accurate question: Basically, you can make an extension permanently modify a web page by defining a content script in manifest.json. I need the ability to, on the click of a button within popup.html, toggle a stylesheet on or off. The answer to my other question I linked to, only allows my to serve a stylesheet, but that is

How to upgrade extension to manifest v2 and remain backwards compatible?

一个人想着一个人 提交于 2020-01-06 09:11:45
问题 I want to upgrade all my extensions to version 2 but still remain backward compatible for people that still have an older versions of chrome installed. Since multiple manifest versions are currently unsupported, I would like to know which is the lowest version of Chrome that will support "manifest_version": 2 and its properties. 回答1: Manifest v2 was introduced in Chrome 18. Using Manifest version 2 adds several requirements to a extension, the most significant being: The default Content

How to upgrade extension to manifest v2 and remain backwards compatible?

别来无恙 提交于 2020-01-06 09:11:31
问题 I want to upgrade all my extensions to version 2 but still remain backward compatible for people that still have an older versions of chrome installed. Since multiple manifest versions are currently unsupported, I would like to know which is the lowest version of Chrome that will support "manifest_version": 2 and its properties. 回答1: Manifest v2 was introduced in Chrome 18. Using Manifest version 2 adds several requirements to a extension, the most significant being: The default Content

Python Selenium Chrome Extension Settings Not Loading Using a .crx File

独自空忆成欢 提交于 2020-01-06 09:00:41
问题 I'm working on Python with Selenium. I figured out how to run Chrome with an extension, the only downside is that the extension has settings and these are always blank when starting an automated Chrome session. Where or how do I save settings when running a crx file? I tried looking in all the files within the extension folder but I did not find my currents settings in them.. Are they maybe stored in the profile? Below the code I'm using to open the chrome driver with extension. import os

Displaying post response (XMLHttpRequest) in chrome extension pop-up apart from python console

血红的双手。 提交于 2020-01-06 08:59:06
问题 I am creating chrome extension that is sending post request with information about specific url that is currently browsed by user to flask (local host) and then some web scraping on this url is done and based on the obtained information a category is assigned. After this process is done I would like the popup to show assigned category when user is on page(s) declared earlier (ofc without user action e.g. clicking on extension icon). At the moment I see this happening on python console but I'm