google-chrome-extension

Chrome web extension not showing notification even though it is working fine in Firefox

感情迁移 提交于 2020-06-29 04:59:08
问题 I have a simple call to the chrome.notifications.create(id,options) function and I have checked the arguments ten times already. The id argument is a string. The options argument is an object like this: {type:"basic",message:"message",title:"message",iconUrl:chrome.extension.getURL("icons/icon.png")} It is only working in Firefox though. Edge Opera and Chrome all fail to display the notification. Edge just crashes! I've checked everything. There are no errors and the iconUrl is correct. Also

clearInterval not working in Chrome extension

懵懂的女人 提交于 2020-06-29 04:08:11
问题 I am trying to make a Chrome extension that: reloads the URL of the tab where the extension is launched (say, for instance, www.example.com ) every 7 seconds and performs a text search for "Text" on it; if "Text" exists, then extensions stops reloading the page, selects a certain radio button and clicks on a certain button on www.example.com. My popup.html is designed with a simple UI with two buttons "Run" and "Stop", respectively running and stopping the reload-and-search function above.

Chrome extension javascript

拜拜、爱过 提交于 2020-06-29 03:55:28
问题 https://i.stack.imgur.com/S0u6W.png For some context look at the image provided, There are 3 type of box that appears in the site automatically every few seconds, "Hi", "Hello" and "Hey". You can click the box and it will be added to the right side. <div class="h-240 rounded relative bg-gray-400 cursor-pointer hover:bg-gray-300 transition duration-75 ease-in-out"> <span class="inline-block ml-10 text-gray-200"> (Hello)</span> </div> <div class="h-240 rounded relative bg-gray-400 cursor

Chrome Extension Icon Manifest

可紊 提交于 2020-06-25 09:54:14
问题 How to change Chrome Extension icon in this page? Here's my manifest code : { "manifest_version": 2, "name": "Demo", "description": "This is demo.", "version": "1.0", "browser_action": { "default_icon": "icon128.png", "icons": { "16": "icon16.png", "48": "icon48.png", "128": "icon128.png" }, "default_popup": "popup.html" }, "permissions": [ "activeTab", "storage" ] } The icon on toolbar is changed, but not on the chrome://extension page. thank you. 回答1: Set "icons" key in manifest.json . The

Chrome extension with declarativeContent.RequestContentScript

倾然丶 夕夏残阳落幕 提交于 2020-06-24 14:48:11
问题 I am trying to make a Chrome extension, which will monitor GMail and do something when user starts to write a message. After some study of examples and documentation I have figured out that I should do it with declarativeContent, which reacts on page change. This is what I have done by now. manifest.json: { "manifest_version": 2, "name": "Gmail helper", "version": "0.1", "permissions": [ "declarativeContent" ], "background": { "scripts": ["background.js"], "persistent": false } } background

how to store AJAX success variable as variable outside of AJAX?

╄→尐↘猪︶ㄣ 提交于 2020-06-23 16:52:39
问题 I used AJAX to get data that I named variable myPubscore. Now I'm trying to send myPubscore to another js file. myPubscore prints fine in Ajax, but when I print just before sendResponse, I get "Error in event handler: ReferenceError: myPubscore is not defined". How do I get myPubscore out of AJAX and into sendResponse? I read through another SO post on this problem, but the respondents mentioned that the answer had depreciated. chrome.runtime.onMessage.addListener(function(request, sender,

chrome sync storage to store and update array

不羁岁月 提交于 2020-06-22 11:42:07
问题 is it possible to store array in chrome storage sync and retrieve them ? var uarray = [abc,def,ghi]; Is it possible to update the stored array in the storage ? var tobeadded = jkl; uarray.push(tobeadded); this was the syntax in documentation chrome.storage.sync.set({'value': theValue}, function() { // Notify that we saved. message('Settings saved'); }); My bookmark extension, need to store the id of bookmark and retrieve them for internal search and stuffs based on it. bookmarking needs

Assign command keyboard shortcut from popup or options

不羁的心 提交于 2020-06-22 10:56:26
问题 Is it possible with the Chrome API to let users assign a keyboard shortcut from within the extension popup or options page? Without them having to go to extensions page, scroll to the bottom and open keyboard shortcut menu. 回答1: In Chrome there's no method to assign a shortcut key programmatically, but you can add a button or a link in the extension popup that will open the built-in dialog. popup.html: <button id="hotkey">Assign a shortcut key</button> <script src="popup.js"></script> popup

How do I use promises in a Chrome extension?

陌路散爱 提交于 2020-06-22 02:59:07
问题 What I am trying to do is create a chrome extension that creates new, nested, bookmark folders, using promises. The function to do this is chrome.bookmarks.create() . However I cannot just loop this function, because chrome.bookmarks.create is asynchronous. I need to wait until the folder is created, and get its new ID, before going on to its children. Promises seem to be the way to go. Unfortunately I cannot find a minimal working example using an asynchronous call with its own callback like