google-chrome-extension

Javascript Template Engines that work with Chrome's Content Security Policy

眉间皱痕 提交于 2020-01-01 08:21:31
问题 The Chrome API's Manifest version 2 has removed the ability to do unsafe-eval. This means using the eval function or in general dynamically creating a function from text. It seems like most if not all Javascript Templating Engines do this. I was using Jaml, but I tried several others like backbone.js (which really uses underscore.js's templating engine) with no luck. This comment on the Chromium project seems to indicate that there are a great many libraries that suffer from this. I think

Javascript Template Engines that work with Chrome's Content Security Policy

点点圈 提交于 2020-01-01 08:21:11
问题 The Chrome API's Manifest version 2 has removed the ability to do unsafe-eval. This means using the eval function or in general dynamically creating a function from text. It seems like most if not all Javascript Templating Engines do this. I was using Jaml, but I tried several others like backbone.js (which really uses underscore.js's templating engine) with no luck. This comment on the Chromium project seems to indicate that there are a great many libraries that suffer from this. I think

Chrome Extension popup.html not display correctly anymore

我是研究僧i 提交于 2020-01-01 07:27:08
问题 I have created a page action extension that uses a popup.html file. It used to work perfectly. When I click the icon it displays a small box with only the corner of the popup.html page visible. I set the body and html css height and width but had no luck of making the box bigger. I also moved the css onto another page called popup.css and added to the popup.html head. Has anyone run into this issue? Please help. HTML: <html> <head> <script type="text/javascript" src="jquery.js"></script>

How to specify author of Extension in Manifest file

邮差的信 提交于 2020-01-01 07:21:08
问题 I Hope Question itself conveys what I want. I wrote a an Extension and want to specify name of the author in Manifest file. Is this possible? If yes.. How can I do that. 回答1: You can specify an author as described at https://developer.chrome.com/extensions/manifest. "author": ..., 回答2: There is no field in the Manifest file to specify the author. You can, however, add a comment in the file where you can write whatever you want. Also note that when you publish your Extension to the Chrome

chrome.storage.sync.set not saving values

久未见 提交于 2020-01-01 05:39:26
问题 So I've run into a bit of snag with regards to local storage on Google Chrome. From what I've researched, my syntax seems to be correct, but for some reason the value is not being saved. Here's my code: chrome.storage.sync.get(accName, function(data) { var accData = data[accName]; // Stuff chrome.storage.sync.set({ accName: accData }, function() { alert('Data saved'); }); }); Every time I re-run it, data[accName] returns undefined. I've tried the same code with literal values for the sync.set

Synchronously get Stored data from content scripts

谁都会走 提交于 2020-01-01 05:28:09
问题 I am currently working on a chrome extension and source code is available on Github. The goal is to inject custom Javascript into webpages. Currently I store each custom Javascript Inject in localStorage and call them from content scipts . I have set run_at to be at document_start . I use this, to get stored injects from background script: chrome.extension.sendMessage({method:"get_injects"},function(injects){ for(index in injects){ if(/^items\./.test(index)){ itemJSON = injects[index]; //if

Chrome Extension - getUserMedia throws “NotAllowedError: Failed due to shutdown”

拥有回忆 提交于 2020-01-01 05:24:06
问题 I have a suite which records the user's webcam and mic. It works great on a webpage, but in a Chrome Extension the line: navigator.mediaDevices.getUserMedia({video: true, audio: true}) .then(this.record.bind(this)) .catch(VidRA.error); is throwing NotAllowedError: Failed due to shutdown I've searched and found almost nothing that might explain this. Has anyone else come across this or does anyone know what I can do about it? 回答1: Wow, this is a minefield. Firstly, it seems this is a bug

Adding drop-down menu to chrome extension icon

北城余情 提交于 2020-01-01 05:17:12
问题 I know that I can associate a popup.html to clicks on the extension button. However, I want it to be a menu, like the one popping up after clicking on Chrome's own "Customize and control Google Chrome" button (located to the right of your extension icons). I tried to Google it but no one seemed to be talking about that. Am I missing any common sense about Chrome extension development? 回答1: You can't. You can either register a click via chrome.browserAction.onClicked but show no UI, or open an

Run Chrome Extensions using command prompt

故事扮演 提交于 2020-01-01 05:16:14
问题 Is it possible to run a chrome extension from command line? I need to automate the process for my software, and my software will need to run that extension with a particular parameter. I am using a Chrome Extension 'APK Downloader' by Yogi. The Extension works like this:- "If a page contains any .apk file link, then when I click on the extension's icon on the address bar, it starts direct download of that .apk file" Now, I have my software that needs some .apk file to download [The software

What is chrome.identity.getProfileUserInfo meant to return?

吃可爱长大的小学妹 提交于 2020-01-01 04:55:27
问题 With Chrome 37 now released, there is a new API available, identity.getProfileUserInfo. I am not really sure what information this is meant to return or what it represents. From the documentation, I thought it would return the email address and id of the user signed into Chrome(i.e. from the hamburger menu), however this is not really true- when I call it(from the context of an extension, which requests the "identity" permission), I get the id of the user signed in that way(and if I paste