google-chrome-extension

javascript addEventlistener “click” not working

南楼画角 提交于 2019-12-22 05:54:16
问题 I am working on making a To-Do list as a Chrome new tab extension. My html file: <head> </head> <body> <h2 id="toc-final">To Do List</h2> <ul id="todoItems"></ul> <input type="text" id="todo" name="todo" placeholder="What do you need to do?" style="width: 200px;"> <button id="newitem" value="Add Todo Item">Add</button> <script type="text/javascript" src="indexdb.js"></script> </body> </html> Previously the button element was an input type with onClick(), but Chrome does not allow that. So I

Do popup.html and background.html share the same local storage?

南楼画角 提交于 2019-12-22 05:42:12
问题 If I understand correctly, popup.html and background.html share the same local storage since they run in the same sandbox. And content script does not share the same one since it run in another sandbox. Right? 回答1: Correct. Calling localStorage from a Chrome extension's Background page, Browser Action page or Page Action page uses the extension's local storage. Content scripts only run on normal web pages and generally can't access Chrome's extension API, so their local storage access would

How to declare Chrome extension to handle specific URL scheme?

主宰稳场 提交于 2019-12-22 05:40:28
问题 I'd like to write an extension that handles specific URLs that have custom scheme (myscheme://). How do I declare my extension so it is invoked on such a request and intercepts it? (The URL can be clicked, typed directly in the address bar, passed in the command line, etc.). This is probably a beginner question, but I'm a beginner! 回答1: There is a JavaScript API that you can use for this. navigator.registerProtocolHandler("mailto", "https://www.example.com/?uri=%s", "Example Mail"); 来源: https

Chrome extension: Could not load javascript file

微笑、不失礼 提交于 2019-12-22 05:39:36
问题 I have posted another question regarding my Chrome extension here. But I have one more question about extensions themselves. I only need a content script for the modification of the Tumblr-Dashboard, no background page or something else, right? Here is the manifest.json file: { "name": "Tumblr - Tiled Dashboard", "version": "0.0.54", "manifest_version": 2, "description": "This extension modifies the look of your Tumblr dashboard.", "icons": { "16": "images/icon_16.png", "48": "images/icon_48

How to darken all elements apart from specific one [closed]

自闭症网瘾萝莉.ら 提交于 2019-12-22 05:31:44
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . I'm building a google chrome extension , I'm doing some work on the right side (in my friend stories), in fact, I'm searching for a specific friend stories whose name appears in the input element after clicking the button. I need to dim/darken all other elements which appear in

How to darken all elements apart from specific one [closed]

不打扰是莪最后的温柔 提交于 2019-12-22 05:31:20
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . I'm building a google chrome extension , I'm doing some work on the right side (in my friend stories), in fact, I'm searching for a specific friend stories whose name appears in the input element after clicking the button. I need to dim/darken all other elements which appear in

Chrome extension: identify web requests of background-page iframe?

♀尐吖头ヾ 提交于 2019-12-22 05:29:13
问题 I'm writing a Chrome extension that periodically checks a web-page on the user's behalf. To be unobtrusive, the page is loaded into an iframe on the extension's hidden background page. Is it possible to identify just the web requests made by this iframe? My initial experiments (see below) seem to indicate that this is tricky. Getting all web requests for a particular tab is easy: you have the tabId, and can filter web requests (via the WebRequest API) with that tabId. But for a background

Chrome app Picasa identity: OAuth2 request failed: Service responded with error: 'bad client id: {0}'

爷,独闯天下 提交于 2019-12-22 05:26:10
问题 I'm trying to authorize with chrome.identity.getAuthToken() to get token for Picasa web service. I couldn't find Picasa API in Google Developer Console and set its scope to "https://picasaweb.google.com/data/" oauth2 part of manifest.json. Picasa docs say that I can skip this step. chrome.identity.getAuthToken({ interactive: true }, function (token) { if (chrome.runtime.lastError) { console.error(chrome.runtime.lastError); } else { console.log(token); } }); getAuthToken() always ends with an

GTM - pushing events/data to gtm dataLayer not sending anything to https://www.google-analytics.com/r/collect?v

淺唱寂寞╮ 提交于 2019-12-22 05:21:43
问题 I have added this gtm code in my chrome extension page(injected by the content script in and iframe) // <!-- Google Tag Manager --> (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','owDataLayer','GTM-XXXXXXX'); // <!-- End Google Tag

How should I securely store passwords and use http auth in a chrome extension

久未见 提交于 2019-12-22 05:04:54
问题 I'm making a chrome extension that requires fetching an xml file from a secure server. I'm currently using XMLHttpRequest() to make a call to the server https://username:password@mydomain.com which returns an xml object that I can parse and display. I want this extension to be available for more than just my hobby use, so it needs an options page to set and store the username and password. How should I store the user password in chrome so that it is secure? chrome has a localStorage global