google-chrome-extension

Deleting DOM elements before the Page is displayed to the screen (in a Chrome extension)

让人想犯罪 __ 提交于 2019-12-30 00:40:10
问题 I am trying to create an extension that will get rid of certain Page elements (by id or class) before the page is displayed to the screen. I've tried using an event listener on the document with "DOMContentLoaded" as the event but the javascript seems to execute after the page is displayed to the user and then deletes it so it's not as smooth as I want (not showing the unwanted content at all) document.addEventListener("DOMContentLoaded", function() { var elements = document

How to synchronize Chrome extension data on different computers?

只愿长相守 提交于 2019-12-30 00:25:07
问题 I have an extension where users maintain a list of links. It would be nice to have this data synchronized between computers (at work and at home). What are the possible solutions? Chrome has extension synchronization option but I am not sure if it synchronizes data or not (I would be surprised if yes). Even if it does, not everyone would want all their other extensions be synced. I can store my links in a special bookmark folder and use built-in bookmark synchronization, but in this case all

Making a unique extension id and key for Chrome extension?

半城伤御伤魂 提交于 2019-12-29 17:51:33
问题 I have a Chrome extension I made, but based it on some example found online. Its not in a crx file. The extension ID is the one used in the example. I would like to change it before I upload my extension to the chrome store. My question is how do I change this? Do I just manually change the letters in my manifest.json file? Or does the extension id have to be generated from something because its in a fixed format? Same for the key, can I just randomly change these two before I do anything

How to programmatically open a chrome extension popup window from background.html

最后都变了- 提交于 2019-12-29 11:38:10
问题 Thanks in advance! What I want to achieve is to open the popup window when a special tag is detected on a webpage by my extension. After searching for a while it seems like the popup can only be opened when user clicks the extension. Is it true? Or could I get the location of my extension's icon on browser? Maybe I could draw a window and display under the extension icon to make it looks just like the popup window. 回答1: It is impossible to get the extension window to open without a user

How to programmatically open a chrome extension popup window from background.html

痴心易碎 提交于 2019-12-29 11:37:12
问题 Thanks in advance! What I want to achieve is to open the popup window when a special tag is detected on a webpage by my extension. After searching for a while it seems like the popup can only be opened when user clicks the extension. Is it true? Or could I get the location of my extension's icon on browser? Maybe I could draw a window and display under the extension icon to make it looks just like the popup window. 回答1: It is impossible to get the extension window to open without a user

Is it possible to hide extension resources in the Chrome web inspector network tab?

亡梦爱人 提交于 2019-12-29 10:03:16
问题 When I'm viewing the downloaded resources for a page in the Chrome web inspector, I also see the HTML/JS/CSS requested by certain extensions. In the example above, indicator.html , indicator.js and indicator.css are actually part of the Readability Chrome extension, not part of my app. This isn't too big a deal in this particular situation, but on a more complex page and with several extensions installed, it can get quite crowded in there! I was wondering if there was a way to filter out any

JavaScript syncronicity: Combining onAuthRequired Listener and native massaging

旧时模样 提交于 2019-12-29 09:35:26
问题 I have this problem ... and I've been trying to get a username and password pair passed to background.js of my extension. The process goes as follows: A Credentials Server (CS) is started up with encrypted credential tokens Selenium opens the browser with custom extension The extension is triggered onAuthRequired The Native Messaging Host (NMH) starts then receives a 'ready' message The NMH uses a simple protocol to request tokens from the CS The NMH decrypts the tokens The NMH passes the

Chrome extension popup installation

天涯浪子 提交于 2019-12-29 09:34:35
问题 This is kind of a stupid question but i couldnt find any help searching around. I would like to know how can i make my chrome extension, when its being installed by a user, to redirect him in a new tab with a link of my website? And where should i put this code? On the background.js i quess. until now my background.js is this code chrome.browserAction.onClicked.addListener(function(tab) { chrome.tabs.executeScript(tab.id, { allFrames: true, file: "content_script.js" }, function() { if (chrome

Chrome extension detect Google search refresh

心已入冬 提交于 2019-12-29 09:32:09
问题 How can my content script detect a refresh of Google's search? I believe it is an AJAX reload of the page and not a "real" refresh, so my events won't detect the refresh. Is it possible to detect it somehow in both a Google Chrome extension and a Firefox WebExtensions add-on? 回答1: Google search is a dynamically updated page. Several well-known methods exist to detect an update: MutationObserver, timer-based approach (see waitForKeyElements wrapper), and an event used by the site like pjax:end