google-chrome-extension

Receiving the Chrome API (chrome.runtime) within Selenium test

丶灬走出姿态 提交于 2019-12-13 06:45:45
问题 I successfully got Selenium tests to work with my Chrome extension. But still I have an issue where the ID of the extension should be received through the Chrome API. Why do I need that? Since the project is within Git I want to ensure that my code buddy can run the tests without configuring much. Everything works fine BUT the ID for the extension differs from every machine. My ID is: chrome-extension:// dafanlbggefkfnbekjceijjhgcancpik /html/options.html What do I need? To receive this ID

Does chrome app id for extensions affect sync storage

杀马特。学长 韩版系。学妹 提交于 2019-12-13 06:21:08
问题 I'm developing a Chrome extension for bookmarks. In the application, I make use of chrome.storage.sync. However, when I'm testing to install the application from a zip file I get different app id:s. This seems to affect sync and thus I'm wondering if there is a way to work around this. 回答1: You need to set the appropriate value for the key property in your manifest (and make sure you always use the same .pem file for packaging your extension). Quoting the docs on manifest's key property: This

Chrome extension messaging between popup.html and content.js

大憨熊 提交于 2019-12-13 06:18:07
问题 So I have this script that runs on a website and gathers some data based on certain parameters, which works perfectly fine by itself, but I want to be able to have a browserAction popup with a single button in it, which on click will trigger the aforementioned script. I believe my problem is that I can't get the message to be sent via a press of the button, I don't know how to implement this, and no browserAction tutorial I've read tried to, either. Here's my code: popup.html <html> <body

Cannot delete URLs with Chrome's history API

為{幸葍}努か 提交于 2019-12-13 06:13:36
问题 I am making a Chrome extension to remove certain URLs from my history, using Chrome's history API. Here is the code so far: document.addEventListener('DOMContentLoaded', function() { var form = document.getElementById('form'), query = document.getElementById('query') form.onsubmit = function(e) { e.preventDefault() // alert(chrome.history) // [object Object] // alert(chrome.history.deleteUrl) // function () { [native code] } // alert(query.value) // whatever I typed chrome.history.deleteUrl

How to perform automatic refresh of extension after installation in chrome extension

主宰稳场 提交于 2019-12-13 06:11:48
问题 Hi I need to know if there is any way to perform auto refreshment of extension after installation.Currently I am using alarms to refresh the extension.But I need to perform automatic refreshment of extension after installation.Is there any way to perform it?Please help me. Below is my code by using alarms. here is my background.js var oldChromeVersion = !chrome.runtime; function getGmailUrl() { return "http://calpinemate.com/"; } function isGmailUrl(url) { return url.indexOf(getGmailUrl()) ==

How can i add an event handler on Gmail sign in button such that that i can store username and password into a local database?

梦想的初衷 提交于 2019-12-13 06:01:41
问题 form.addEventlistener("submit", function() { var data = form.elements["Passwd"].value; evt.preventDefault(); chrome.extension.sendRequest({'data':data}, function(response) { alert(response); }); }); above code is in content script.js which invoke an event on signIn button. function onRequest(request, sender, sendResponse) { sendResponse('password field found'+request.data); }; above is in background.js which recceives the message from contentscript.js var signup = document.getElementById(

Chrome extensions: variable undefined in chrome extension even though it exists in console

落花浮王杯 提交于 2019-12-13 05:19:21
问题 In my content scripts for my chrome extension, I dynamically load a external js file onto a html page once it is finished loading. This js file I load will define a variable called rfk . I have a set Interval for when rfk is defined, it will execute a script. However, even after succesfully loading the page, my content script will never find rfk to be defined, even though I can check through the browser console and find that rfk exists. "content_scripts": [ { "matches": ["*://www.att.com/*"],

TS2345: Argument of type 'number | undefined' is not assignable to parameter of type 'number'

岁酱吖の 提交于 2019-12-13 05:16:19
问题 I am trying to create a chrome extension in typescript. I have the following code, where I try to send a message to contentscript from the background script. // background script chrome.tabs.query({active: true, currentWindow: true}, function(tabs){ chrome.tabs.sendMessage(tabs[0].id, {action: "open_dialog_box"}, function(response) { console.log(response); }); }); but typescript is giving the following error ERROR in /Users/shobi/Projects/Chrome Extensions/src/js/background.ts(8,37) TS2345:

CHROME ext/app - single click for image download

試著忘記壹切 提交于 2019-12-13 05:14:13
问题 I would like a simple Chrome App or Ext to download images faster. Currently, you have to right click and choose save as, etc. I have looked at this APP which came close (https://chrome.google.com/webstore/detail/save-image-to-downloads/enjefpkmlibebgbbgidmhpmjhcdffhfm?hl=en). Manifest: { "background": { "scripts": [ "save_to_downloads.js" ] }, "description": "Adds a right-click direct download item for images, like Safari.", "icons": { "128": "icon128.png", "16": "icon16.png", "48": "icon48