google-chrome-extension

Keep Popup Open when Opening a new Page

ε祈祈猫儿з 提交于 2019-12-20 07:14:25
问题 I have the following code to introduce my Chrome Extension. // detect if this is the first time running var first_run = false; if (!localStorage['ran_before']) { first_run = true; localStorage['ran_before'] = '1'; } // if not, start the intro() script if (first_run) intro(); // intro script function intro() { window.open("intro/index.html", '_blank'); } But sadly, when I click the extension, it doesn't open the popup.html but just opens the intro page.. it needs to keep the popup.html open

How could i achieve to access the data which where set on options page in the content script eg. in the google chrome extension

依然范特西╮ 提交于 2019-12-20 06:43:02
问题 I am setting some values at the option page. This is now working okay. But i am unable to access the data setted in the background.html or in the content script. I have read that something like this is possible with messaging but for me is the documentation a little bit hard to understand. If someone could point me out in the right direction it would be good. Example story> I am setting this value at the options page localStorage.setItem("somedata" , "true"); Then if i would access the same

How do I get a list of filenames in a subfolder of a Chrome extension?

时光毁灭记忆、已成空白 提交于 2019-12-20 05:59:13
问题 I was wondering if it is possible to get a list of filenames of all files in a subfolder of a Chrome extension. Thank you! 回答1: Use the chrome.runtime.getPackageDirectoryEntry method to get a DirectoryEntry for the Chrome extension, then use the FileSystem API to query its contents chrome.runtime.getPackageDirectoryEntry(function(directoryEntry) { var directoryReader = directoryEntry.createReader(); // List of DirectoryEntry and/or FileEntry objects. var filenames = []; (function readNext() {

Chrome Extension - Passing variables from HTML file to .js file

痴心易碎 提交于 2019-12-20 05:58:15
问题 I am trying to pass a variable from the HTML of my Chrome extension into my content_script.js file. First time using javascript so I'm pretty lost. I have tried a few things but none of them seem to work. Here is my latest attempt: popup.html <html> <head><title>activity</title></head> <body> <input id="email" type="email" placeHolder="Email" /> <br /> <button id="clickactivity">Create Account</button> <br /> <script src="popup.js"></script> </body> </html> popup.js function injectTheScript()

Another Cross-XHR related

元气小坏坏 提交于 2019-12-20 05:57:21
问题 I know that there's a bunch of questions about the "not allowed by Access-Control-Allow-Origin." error. But I've tried some of them without success. :( Some appointments: I'm trying to build a dev-tools-tab extension I can touch flickr API like the example shows I can't reach localhost Already tried several permission wildcards http://localhost/ http://*/ *://*/ Already tried pack'd and unpack'd extensions currently, manifest.json has "version": "0.0.1", "manifest_version": 2, "devtools_page"

Loading multiple instances of requireJS and Backbone

做~自己de王妃 提交于 2019-12-20 05:47:26
问题 I am creating a google chrome extension which, when activated on a tab, loads some custom code and a few new views into the document of that window. I'd like to use requireJS to load these new modules of code called by the extension. However, I worried about a possible conflict or name collision that might occur if the app/website this extension is called on is already running requireJS, and my calling it from scratch either wipes the sites native require.config or otherwise causes some

How can I instruct Chrome Extension to NOT reload my HTML each time it is opened?

丶灬走出姿态 提交于 2019-12-20 05:46:33
问题 I am working on a Chrome Extension and I need it to maintain its state each time it is opened. For example, I have an input element that needs to stay filled-in after I close and re-open the extension. On this page, I found an example of the manifest. It lead me to add the following to my manifest, but it didn't work: "background": { "persistent": true, "page": "popup.html" } Is there a way to maintain the extensions state between openings? 回答1: First things first, read the Architecture

Apparent fake installs of Chrome extension [closed]

◇◆丶佛笑我妖孽 提交于 2019-12-20 05:42:13
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . We have a new extension that we built for many months and is live on the webstore. Our extension communicates with our API and we get many fake installs daily - installs that we see in our API and not in the web

Apparent fake installs of Chrome extension [closed]

删除回忆录丶 提交于 2019-12-20 05:42:09
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . We have a new extension that we built for many months and is live on the webstore. Our extension communicates with our API and we get many fake installs daily - installs that we see in our API and not in the web

BrowserExtension webRequest.onBeforeRequest return promise

心已入冬 提交于 2019-12-20 05:19:09
问题 I have the following in a Chrome and FireFox extension: function webListener(requestDetails) { var asyncCancel = new Promise((resolve, reject) => { resolve({ cancel : true }); }); return asyncCancel; } chrome.webRequest.onBeforeRequest.addListener( webListener, { urls: ["<all_urls>"], types: ["script"] }, ["blocking", "requestBody"] ); The problem is that it doesn't cancel the request. I read Chrome docs and Firefox docs and for Firefox it says it's based on Chrome's API and can return a