google-chrome-extension

Can a chrome application launch local program?

坚强是说给别人听的谎言 提交于 2019-12-17 21:19:15
问题 I now that chrome applications can deliver an experience close to that of native applications, but I could not find a way yet to run a local command from a chrome application. Is there any API for this that could used after the user has given permission? How can this be done? Thanks 回答1: It is in principle possible via Native Messaging. You can have a native app specifically designed to talk to your Chrome app, but the downside is that the native component cannot be bundled with the app in

Chrome extension regarding injected script + localstorage

*爱你&永不变心* 提交于 2019-12-17 21:16:57
问题 I am puzzling my way through my first 'putting it all together' Chrome extension, I'll describe what I am trying to do and then how I have been going about it with some script excerpts: I have an options.html page and an options.js script that lets the user set a url in a textfield -- this gets stored using localStorage. function load_options() { var repl_adurl = localStorage["repl_adurl"]; default_img.src = repl_adurl; tf_default_ad.value = repl_adurl; } function save_options() { var tf_ad =

google chrome extension- popup page not showing correctly

本小妞迷上赌 提交于 2019-12-17 21:14:27
问题 I am working to create a Google Chrome Extension- in this extension, there is a popup page that uses Accordion- via Jquery UI. Now, I have correctly defined the popup.html file in manifest.json, and added the code of "start" theme of Jquery UI to the popup.html file. However when I click on the button in toolbar which should display the popup, then all sections of the accordion are being shown opened- and the accordion is not being shown at all-- all I can see is the plain text for various

Highlight a word of text on the page using .replace()

淺唱寂寞╮ 提交于 2019-12-17 21:07:51
问题 I'm developing a Google Chrome extension that allows you to automatically apply a highlighting CSS rule to a word that you choose. I have the following code var elements = document.getElementsByTagName('*'); for (var i=0; i<elements.length; i++) { var element = elements[i]; for (var j=0; j<element.childNodes.length; j++) { var node = element.childNodes[j]; if(node.nodeType === 3) { var text = node.nodeValue; var fetchedText = text.match(/teste/gi); if(fetchedText) { var replacedText = element

Chrome Extension Message Passing [duplicate]

我只是一个虾纸丫 提交于 2019-12-17 21:00:02
问题 This question already has answers here : Chrome Extension Message passing: response not sent (3 answers) Closed 5 years ago . I have a chrome extension that's sending a login message: chrome.runtime.sendMessage data, (response) -> debugger if response.api_key $("body").fadeOut 1000, -> window.close() else App.Ui.clearForm() App.Ui.showErrorMessage() However, the callback is never hit: chrome.runtime.onMessage.addListener (request, sender, sendResponse) -> if request and request.action is

Unable to check runtime.lastError during browserAction.setBadgeText

ε祈祈猫儿з 提交于 2019-12-17 20:53:28
问题 chrome.browserAction.setBadgeText(object details) is used to set the badge text for a chrome extension. However, if the tabId doesn't exist, Chrome produces the following error using console.error() : Unchecked runtime.lastError while running browserAction.setBadgeText: No tab with id: ####. This becomes a problem when the badge text is set during a page load. If the tab originally exists but is closed by the user, setBadgeText ends up being called using a non-existent tabId . Normally, this

Highlight URL bar using Chrome and Safari extension

与世无争的帅哥 提交于 2019-12-17 20:49:17
问题 Is it possible to highlight the URL bar (set focus to the location bar) using Google Chrome extensions or Safari extensions? Using Firefox extensions, one can highlight the URL bar like this: var addressBar=document.getElementById('urlbar'); addressBar.focus(); addressBar.select(); I'm not sure if there's similar functionality in Chrome and Safari. Thanks in advance for your help! 回答1: Firefox, in its plugins and extensions gives access to browser's "chrome" (the UI stuff around the page)

Chrome extension: enter data into a custom-handled input field

依然范特西╮ 提交于 2019-12-17 20:33:25
问题 My extension has a context menu with items. What I'd like it to do: is when I right-click an editable html element (eg input or textarea) and then select and click on an item in my menu - some value defined by my extension gets entered into the input. For now I have realised that with document.activeElement.value = myValue . With simple inputs it works alright. Problems start when there is an input with custom onChange event handling, eg a calendar or a phone input, or currency input - that

How can I send a message from Google Chrome extension to desktop application?

痞子三分冷 提交于 2019-12-17 20:19:36
问题 I have a Windows desktop application which must work in collaboration with my Chrome extension. Can I send a message to my desktop app somehow from Google Chrome extension? Which IPC objects can I use? 回答1: I see three options: You could use the internet. You can have a remote service that both the chrome extension and your desktop app talk to, to communicate. You could have your desktop app have a simple server built into it so that the chrome extension can make local http requests to it to

how to make on/off buttons/icons for a chrome extension?

孤人 提交于 2019-12-17 20:19:30
问题 I want to let the user decide when they want to run a script, so that when the browser opens, the "off" icon is showing and no script runs; but when the user clicks it, it changes to an "on" icon and executes a userscript, until the user clicks off. I have two png icons which are 32x32 each: on.png and off.png . My two questions: How can I set the default icon to my off.png? I tried this in my manifest.json but it didn't set the icon, instead showed a puzzle piece (I presume a default): ...