google-chrome-extension

Javascript Button onClick not working in Chrome extension popup

只谈情不闲聊 提交于 2019-12-25 06:35:13
问题 (link to git: https://github.com/Boundarybreaker/NameBlock) I'm working on a text-replacement extension that can be toggled on and off with a button clicked in the popup.html , but it only is happening when I click the icon. (video: https://drive.google.com/file/d/0B_3pLT_KI8V8OHJFUHQ5a1JURkE/view?usp=sharing) The code for the button reads <button class="ui fluid red button" onclick=toggleActive() id="toggle">Toggle Active</button> , and toggleActive() is a function in background.js , along

Chrome extension that captures and redirects anything typed in the URL/search bar

拈花ヽ惹草 提交于 2019-12-25 06:04:35
问题 I would like to create an extension that will manipulate anything (mathching a pattern) typed in the URL bar and make an apriopriate redirect. Being more specific: I would like to type an URL of such format: _http://<something> . I would like chrome to redirect this http://<something> . Here is what I came up with (basing on this answer): manifest.json { "name": "_Replace", "description": "Replace '_http' with 'http'", "version": "1.0", "manifest_version": 2, "background": {"scripts":[

How to keep the eventlistener real time for chrome extensions?

一世执手 提交于 2019-12-25 05:33:20
问题 How would I go about calling my function in a way that it is always running. I want to get the text selection wherever the user double clicks. So I don't know how to attach the eventlistener that always stays on. not just a one time function when the document is loaded. but more like an ongoing eventlistener as long as the tab is open? Thanks you so much! 回答1: In order to achieve what you describe (and to have it always available on every tab), you can use a content script and have it

Comparing user-specific URL list with current URL?

删除回忆录丶 提交于 2019-12-25 05:32:17
问题 I have a whitelist where users can enter specific URLs/URL patterns (only targetting http and https . I would like to transfrom and compare these URL/URL patterns so that the wildcard selector ( * ) can be used like so user enters: example.*/test I want to transform this to: *//*.example.*/test so that it matches: http://www.example.com/test , https://example.co.uk/test Another example: user enters: http://www.*.com/* I want to transform this to: http://www.*.com/* so that it matches: http:/

Comparing user-specific URL list with current URL?

℡╲_俬逩灬. 提交于 2019-12-25 05:32:08
问题 I have a whitelist where users can enter specific URLs/URL patterns (only targetting http and https . I would like to transfrom and compare these URL/URL patterns so that the wildcard selector ( * ) can be used like so user enters: example.*/test I want to transform this to: *//*.example.*/test so that it matches: http://www.example.com/test , https://example.co.uk/test Another example: user enters: http://www.*.com/* I want to transform this to: http://www.*.com/* so that it matches: http:/

Comparing user-specific URL list with current URL?

拟墨画扇 提交于 2019-12-25 05:32:03
问题 I have a whitelist where users can enter specific URLs/URL patterns (only targetting http and https . I would like to transfrom and compare these URL/URL patterns so that the wildcard selector ( * ) can be used like so user enters: example.*/test I want to transform this to: *//*.example.*/test so that it matches: http://www.example.com/test , https://example.co.uk/test Another example: user enters: http://www.*.com/* I want to transform this to: http://www.*.com/* so that it matches: http:/

Remove Google Chrome extension by a VBScript?

我们两清 提交于 2019-12-25 05:13:39
问题 Is it possible to remove the extension on Google Chrome via a VBScript? The extension is stored in the following folder, %LOCALAPPDATA%\Google\Chrome\User Data\Default\Extensions The extension data is stored in a JSON file called "Preferences" in the following folder location, %LOCALAPPDATA%\Google\Chrome\User Data\Default Furthermore, if the "Preferences" file is modified then Google Chrome detects it and resets the "Preferences" file. If we remove the lines where the specific extension data

How to create chrome tab of develop Chrome Extension like window.location?

北城余情 提交于 2019-12-25 04:58:07
问题 I am developing a chrome extension. I have a requiremen that is create a new tab with some params like javascript 'window' function. By default javascript window function, i need to set this code as below then window.location.replace allow permission to access the page in new window. window.name = JSON.stringify({ id : 'tmp', companyCode : companyCode, locationCode : locationCode, terminalNo : terminalNo, terminalKey : terminalKey, server:{ protocol : protocol, remoteHost : remoteHost,

localization in Chrome extensions

帅比萌擦擦* 提交于 2019-12-25 04:45:31
问题 I have a query related to localization of Chrome extensions. I am trying to localize the text in a button in a popup html file in my extension. The code I am using is as follows: <button name="buttonSave" id="buttonSave" style="width: 100px; float: right;"> <label class="buttonTextStyle"> </label> </button> The javascript code is as follows: document.getElementById("buttonSave").innerText = chrome.i18n.getMessage("SaveButton"); I have tried using innerText, innerHTML, value but the text in

How can i execute a javascript when a user clicks a button

落爺英雄遲暮 提交于 2019-12-25 04:44:22
问题 I am creating an extension for Chrome. I want to execute a script when the user clicks a button. Here is the code i currently have in my html file <input type="button" id ="button" onclick='notEmpty()' value="Play"/> The notEmpty() is in a javascript (.js) file. How can I execute another script in the notEmpty() function? 回答1: If you want to use functions that are located in another file, you would need to import those files: <script type="text/javascript" src="/path/to/script.js"></script>