google-chrome-extension

Chrome Extension on Facebook with Dynamic Posts

陌路散爱 提交于 2020-01-06 08:42:05
问题 Sorry, I think this post probably exists but I couldn't find it. Maybe I am using the wrong words. I am making a Chrome extension that looks at Facebook posts and does something to them. My Content Scripts gets the posts correctly, but the new ones that are generated as the user scrolls down are not captured since they came later. I tried hooking into an ajaxComplete handler, but that didn't work (Chrome-extension Javascript to detect dynamically-loaded content) I am not sure if I did

How to add picture BY URL using Gmail API (Chrome extension)

不想你离开。 提交于 2020-01-06 08:13:32
问题 I write Chrome extension and need to add a picture in the mail by URL(in js). I can't find how to do that in Gmail API documentation. The only link I found is this, but don`t understand how to use it( add picture icon add by link 来源: https://stackoverflow.com/questions/58767523/how-to-add-picture-by-url-using-gmail-api-chrome-extension

How to add picture BY URL using Gmail API (Chrome extension)

徘徊边缘 提交于 2020-01-06 08:12:10
问题 I write Chrome extension and need to add a picture in the mail by URL(in js). I can't find how to do that in Gmail API documentation. The only link I found is this, but don`t understand how to use it( add picture icon add by link 来源: https://stackoverflow.com/questions/58767523/how-to-add-picture-by-url-using-gmail-api-chrome-extension

chrome.tabs.onUpdated.addListener triggers multiple times

自古美人都是妖i 提交于 2020-01-06 08:05:53
问题 I observe that the onUpdated listener for the tabs API in Chrome does trigger multiple times. When I refresh the existing tab, the alert pops up 3 times When I load a different URL, the alert pops up 4 times In the alert popup, I also see that there seem to be "intermediate" title tags. How can I avoid this and reduce action to the final update? chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { /* Multiple Tasks: 1. Check whether title tag matches the CPD Teamcenter title

Remove variables starting with a string from chrome.storage.local in JavaScript

泄露秘密 提交于 2020-01-06 07:55:29
问题 In a chrome extension, I store some variables in chrome.storage.local like this: chrome.storage.local.set({["name" + counter]: ""}, function() {}); (many thanks to Xan's answer regarding ES6 computed property names here), where counter is basically an incremented number. How can I use chrome.storage.local.remove to remove all the variables starting with "name" that were previously stored, when I don't need them anymore? Note: I use this type of storage ("name0", "name1", ...) as I can't store

Remove variables starting with a string from chrome.storage.local in JavaScript

痞子三分冷 提交于 2020-01-06 07:55:07
问题 In a chrome extension, I store some variables in chrome.storage.local like this: chrome.storage.local.set({["name" + counter]: ""}, function() {}); (many thanks to Xan's answer regarding ES6 computed property names here), where counter is basically an incremented number. How can I use chrome.storage.local.remove to remove all the variables starting with "name" that were previously stored, when I don't need them anymore? Note: I use this type of storage ("name0", "name1", ...) as I can't store

Chrome extensions: chrome.storage.local.get headache

有些话、适合烂在心里 提交于 2020-01-06 06:48:10
问题 Trying to build a simple Chrome extension to output the whole contents of localStorage. How difficult should it be? Spent a few hours researching and trying, still doesn't work :( Appreciate assistance! For example: function load() { chrome.storage.local.get(null, function(items) { var allKeys = Object.keys(items); alert(allKeys.count); }); } document.addEventListener('DOMContentLoaded', () => { load(); }); outputs 'undefined' Some other ways I tried actually contained an object, but I couldn

Chrome extension programmatic script injection error

我是研究僧i 提交于 2020-01-06 05:22:27
问题 Following up on a previous post, I am now trying to create a version of a Chrome extension that does not specify content_scripts: or matches: in the manifest.json file; instead the content script is to be injected programmatically by a en event triggered from the options page which prompts the user to grant optional permissions for executing the content script. The rationale is to be able to have the extension working on pages from hosts with different top-level domain names (see previous

Chrome extension read innerHTML of the current page?

江枫思渺然 提交于 2020-01-06 05:21:27
问题 Hi this may be a silly question, but I can't find the answer anywhere. I'm writing a chrome extension, all I need is to read in the html of the current page so I can extract some data from it. here's what I have so far: <script> window.addEventListener("load", windowLoaded, false); function windowLoaded() { alert(document.innerHTML) }); } </script> Can anybody tell me what I'm doing wrong? thanks, 回答1: function windowLoaded() { alert('<html>' + document.documentElement.innerHTML + '</html>');

Chrome extensions: open link in new tab upon loading of a particular page?

倖福魔咒の 提交于 2020-01-06 05:05:32
问题 I'd like to create a Chrome extension where, when a particular URL opens, another URL opens automatically in a new tab. Note that I'd like the new tab to open as soon as the first URL begins to load, not once it's finished loading. So basically, you'd click on a link to the first URL, and two tabs would open; one containing the first URL, one containing the second URL. However, I really don't know where to begin. I don't think it can be a content script because they can't access chrome.tabs.