google-chrome-extension

Secure handling of OAuth Consumer Key and Secret in Chrome Extensions and Gmail Gadgets

非 Y 不嫁゛ 提交于 2019-12-19 18:24:54
问题 I would like to get some ideas on to properly handle Salesforce OAuth Consumer Key and Secret in Chrome Extensions and Gmail Gadgets. Chrome extensions are essentially Javascript wrapped up in a zip compatible format. If I need to build an extension that calls Salesforce APIs on behalf of the user, I have to embed the Salesforce generated App OAuth Consumer Key and Secret in Javascript for the extension. This creates the possibility of disclosure of the OAuth Consumer Key and Secret, and

Secure handling of OAuth Consumer Key and Secret in Chrome Extensions and Gmail Gadgets

夙愿已清 提交于 2019-12-19 18:21:15
问题 I would like to get some ideas on to properly handle Salesforce OAuth Consumer Key and Secret in Chrome Extensions and Gmail Gadgets. Chrome extensions are essentially Javascript wrapped up in a zip compatible format. If I need to build an extension that calls Salesforce APIs on behalf of the user, I have to embed the Salesforce generated App OAuth Consumer Key and Secret in Javascript for the extension. This creates the possibility of disclosure of the OAuth Consumer Key and Secret, and

Read file packaged with Chrome extension in content script

人走茶凉 提交于 2019-12-19 16:58:51
问题 I am developing a Chrome extension that needs to package an XML file (a trie data structure) and be able to read that file from the content script. So the content script will instantiate the trie after reading the data from the XML file every time the extension is loaded. How to read this XML file through content script (or background page)? Do I need to use localStorage? 回答1: A simple ajax request to the XML file should give you the XML DOM nodes: function request(url) { var xhr = new

How to open a file which includes in Chrome extension by C/C++?

只谈情不闲聊 提交于 2019-12-19 12:55:22
问题 I'm trying to open a file to parse, say "config.txt", in my Chrome extension. By Javascript it will be fairly easy. For example: chrome.extension.getURL('config.txt') will get something like chrome-extension://kfcphocilcidmjolfgicbchdfjjlfkmh/config.txt . However, in the C++(or C) code of the extension, open a file by this kind of URL is not available. Is there any way to open a file in extension in this case? 回答1: There are two ways you could address this; the first is to simply use

How to open a file which includes in Chrome extension by C/C++?

有些话、适合烂在心里 提交于 2019-12-19 12:55:21
问题 I'm trying to open a file to parse, say "config.txt", in my Chrome extension. By Javascript it will be fairly easy. For example: chrome.extension.getURL('config.txt') will get something like chrome-extension://kfcphocilcidmjolfgicbchdfjjlfkmh/config.txt . However, in the C++(or C) code of the extension, open a file by this kind of URL is not available. Is there any way to open a file in extension in this case? 回答1: There are two ways you could address this; the first is to simply use

Is chrome tabId unique across windows

China☆狼群 提交于 2019-12-19 12:38:22
问题 I need to know if the chrome tabId is unique across all the open windows. Incognito and normal. Is it guaranteed that non of the open tabs in all the windows will have the same tabId ? I searched the documentation but could not find any reliable answer. 回答1: Yes, the tab ID is unique within a browser session . It's also mentioned in the documentation of chrome.tabs: Tab ( object )     id ( integer )        The ID of the tab. Tab IDs are unique within a browser session . If you still don't

Chrome debugger - how to turn off console.log message grouping?

我的梦境 提交于 2019-12-19 12:04:54
问题 Say, in my Google Chrome extension I do this: console.log(msg); and the Chrome debugger groups similar messages like so: Is there any any to turn it off and have messages post just as they are? 回答1: It only collapses consecutive rows that are identical, I don't see it as much of a problem, but with the settings button in the top right corner of the console you can enable 'Show timestamps' which will put them on different lines: You can see they only collapse consecutive duplicates with this:

Chrome Extension - Use javascript to run periodically, and log data permanently

北战南征 提交于 2019-12-19 11:56:10
问题 Currently, I have a script that when the image in the top right tray is clicked(only for one specific allowed website), it scans the pages HTML then outputs some value. This scanning and outputting is a function in a single JS file, called say checkData.js. Is it possible, even if a user is not actively using a tab but it is open, to automatically have the script run every 10 seconds and log data to some place I can access later within the extension? THis is because the pages HTML is

Chrome Extension: Message Passing (Sending the DOM to popup.js) returns 'null'

末鹿安然 提交于 2019-12-19 11:40:18
问题 I would like to use a Chrome Extension to download the current page's DOM. I'm not sure why, but when my download occurs, the result is just a text file with either 'null' or 'undefined', rather than the DOM. I've tried to assimilate the knowledge from here and here, but I can't seem to get the message from content.js through to popup.js . Additionally, I'm not sure why this actually works. When I read the docs, it seems like I need to send the message from popup.js to content.js by selecting

How to download all files from Chrome Extensions example (subversion repo)?

我怕爱的太早我们不能终老 提交于 2019-12-19 10:49:12
问题 I would like to download this examples. They are shown using ViewVC (which I believe is related to subversion) and it seems that there is no easy way of downloading from there, according to this Stackoverflow question (but the answers are from 2011). Is there any way to easily access those files? I don't mind command line tools. Thanks. 回答1: Every extension example in the source code is available as a zip file as well, directly linked at https://developer.chrome.com/extensions/samples. If you