google-chrome-extension

How to launch Chrome Extension using Automation (Robot Framework, etc.)

让人想犯罪 __ 提交于 2021-01-29 09:27:42
问题 I need to launch a particular chrome extension in my automation. I am currently using Selenium with Java. But I am unable to launch my chrome extension. 回答1: Basicaly there are two approaches. 1. install desired extension in runtime - https://dev.to/razgandeanu/testing-chrome-extensions-with-selenium-491b 2. manualy install desired extension do existing browser profile and use the existing profile in selenium . Like this: package packageName; import org.openqa.selenium.WebDriver; import org

How do I store Chrome extension data securely?

与世无争的帅哥 提交于 2021-01-29 09:01:14
问题 Chrome extension documentation explicitly states that storage.sync data is not encrypted: "Confidential user information should not be stored! The storage area isn't encrypted." What is the recommended method to: 1) Save persistent data securely (ie, no loss from restarting browser or logging into Chrome on a different device) 2) Without transferring anything to my server (unnecessary in my case and want to give user full data control) 回答1: You can't - that's the thing. Google Chrome docs

How to wait for content script listener to load after background script opens URL?

旧时模样 提交于 2021-01-29 08:55:43
问题 My background script should open an URL and wait for it to load completely, so the content script's listener is ready (Am i right with this?). Then it should send the message "newURLvisited" to the content script. The content script receives the message and gets all links from the website and clicks on one (for example index 10). Normally the content script would activate itself by doing so, because my manifest.json matches all urls (which is necessary for me). I wanted to fix this problem by

When should I start a native message host when targeting both Google Chrome and Edge Chromium?

一曲冷凌霜 提交于 2021-01-29 08:34:37
问题 I have a Google Chrome Extension which uses a native host. This is used only on a windows box and the extension's registry settings are added along with the installation of the native host exe. Currently the the port (chrome.runtime.connectNative) or native host is started when the extensions background script is loaded. This currently means that the native host runs whenever Google Chrome is running. The extension is used for only 1 website "www.example.com" and so content scripts only run

JavaScript Google Chrome extention that adds a feature to search highlighted text on specific webpages from a custom context menu

此生再无相见时 提交于 2021-01-29 08:06:36
问题 I am trying to write the Chrome extension, when you right-click on the word(email) it will search it on custom fields on a list of webpages, in new tabs. Tried to copy Simple=Select+Search extension, but it requires adding %s in the search link, instead of the search item and some of my links does not change after you press "search" Like here This is the function that does the search the function generates the actual search URL combining the selected text with the search engine config fixes

Chrome extension: insertCSS once per tab

蓝咒 提交于 2021-01-29 07:48:50
问题 My extension has a button that injects a stylesheet with insertCSS . When they press the button again, it'll inject the again, causing a repaint. How can I best prevent this? My current solution: keep an array in the background script with every tabId that has CSS inserted. I remove the tabId from the array when a tab is unloaded. Works fine, but it seems this could be simpler. E.g. window.insertedCSS = true , but doing this from the background script affects all tabs. 回答1: You can use a

Display a Chrome desktop notification every day at specific time

泄露秘密 提交于 2021-01-29 07:17:08
问题 I'd like to write an extension that displays a desktop notification every day at a specified time. Having a quick look through the Chrome APIs, it seems like the only way to do this would be to: create a background page for my extension, use setInterval() with a sufficiently low resolution to not tax the CPU (even 5 min is fine), when interval fires, check if the current time is after the desired time, ensure that the user has not already been displayed the notification today. (The details of

Why am I getting an error when I click chrome extension?

我怕爱的太早我们不能终老 提交于 2021-01-29 07:16:14
问题 I am trying to create a simple chrome extension. I was able to load the extension but when I clicked the extension icon next to the address bar I get an error : Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist. Why? My manifest.json file : { "name" : "Test", "version" : "0.1", "permissions" : ["<all_urls>", "tabs", "activeTab"], "content_scripts" : [ { "matches" : ["<all_urls>"], "js" : ["content.js"] } ], "background" : { "scripts" : ["background.js"]

How i can insert google tag manager to popup in chrome extension?

半世苍凉 提交于 2021-01-29 06:11:37
问题 I have created chrome extension. I add google tag manager script and no script iframe in popup html like this: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Signals</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true

Chrome Plugin Storage : Local Testing

≯℡__Kan透↙ 提交于 2021-01-29 05:27:10
问题 Code snippet: if(localStorage.getItem("recording")!= null && localStorage.getItem("recording")=="true" && action.element!=null){ actions.push(action); actions=processActions(actions); localStorage.setItem("actions",JSON.stringify(actions)); } With recent version of chrome have started to face issues testing chrome extension with local storage. We have developed an chrome extension which requires storage access. In Local, we used to upload unpacked extension and then we were able to test the