google-chrome-extension

How to download PDF automatically using js?

∥☆過路亽.° 提交于 2019-12-18 01:04:29
问题 My scenario is that PDF file download automatically, then user fills it and when click on submit button in PDF it connect to java servlet and save it in DB. 1 - User click on Button 2 - JavaScript code run and PDF file download automatically 3 - open file using JavaScript automatically 4 - user fills & press submit 5 - after submit servlet code run and save data in db In my Application just the 2nd point is missing. Please provide code how to interact with extension using JavaScript to

Can't connect to localhost from Chrome extension

强颜欢笑 提交于 2019-12-17 23:33:57
问题 I am working on a Chrome extension that tracks time, and uses Google App Engine for the backend. For testing, I'm trying to connect a local version of the extension to a local version of the App Engine app. When I try to send a POST request, I'm getting: XMLHttpRequest cannot load http://localhost:8080/report . Origin chrome-extension://mbndmimplohfkkcincjodnfpaapbbmei is not allowed by Access-Control-Allow-Origin. But it works when I change the URL so that it posts to the appspot.com URL.

Securing website API keys in Chrome extensions

百般思念 提交于 2019-12-17 23:28:09
问题 I'm building a Chrome extension using the Remember the Milk web API. In order to call methods in this API, I need to sign my requests using an API key and a "shared secret" key. My concern is that any user could just crack open the extension and pull out these values if I include them in the published extension. This may or may not pose a security rise for the user, but he or she could certainly use/abuse my API key and maybe get it revoked. Is this something I should be concerned about? Are

Chrome Extension : How to intercept requested urls? [closed]

社会主义新天地 提交于 2019-12-17 22:51:33
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . How can an extension intercept any requested URL to block it if some condition matches? Similar question for Firefox. What permission needs to be set in manifest.json? 回答1: JavaScript Code : The following example illustrates how to block all requests to www.evil.com: chrome.webRequest

Merging Text Nodes Together After Inserting Span

泪湿孤枕 提交于 2019-12-17 22:44:49
问题 I have an extension where I am storing/retrieving a section of the DOM structure (always a selection of text on the screen) the user has selected. When I am storing a selection, I enclose the section in a SPAN tag, and highlight the text in yellow. This causes the DOM structure around the selected text to split up into various text nodes. This causes a problem for me as when I try to restore this selection (without refreshing the page) it causes problems as the DOM structure has been modified

How to launch a new window in Google Chrome Extension

旧时模样 提交于 2019-12-17 22:36:05
问题 I'm trying to develop a Extension for Google Chrome, but I have some problems, I want to launch or create a new window when user click on it in the icon. Like this: http://i.imgur.com/8iRkEOb.png Thanks so much! 回答1: First off, if you have a default_popup defined in the manifest - you need to remove it, as it interferes with the click event you want to catch. Then, you need to catch the event in a background script: chrome.browserAction.onClicked.addListener(function(tab) { // ... }); Next,

Obtaining “this” tab ID from content script in Chrome extension?

China☆狼群 提交于 2019-12-17 22:33:29
问题 From a content script, is it possible to access that tab's ID? I want to send a message to the background page from the content script that tells my extension to "do something with this tab" using the chrome.tabs.* api. A TabID is needed, and there is no point in doing a bunch of logic in the background page to hunt for a TabID when my content script can simply tell it the TabID in the message contents. 回答1: Tab id is automatically passed inside MessageSender object: chrome.runtime.onMessage

Google Chrome extension - how to turn JavaScript on/off?

ε祈祈猫儿з 提交于 2019-12-17 21:49:16
问题 Is it possible to turn JavaScript on/off with a self-made Google Chrome extension ? For example, in Opera browser, there are simple possibilities to do that with widgets, user-made buttons, etc., but I didn't find any solutions to do that in Chrome (my first source was the official Google Chrome extensions' documentations). A strange aspect is that I need JavaScript to run the extension itself...if I'm able to turn JavaScript off with an extension, can I still use JavaScript in my extension

Chrome Browser Action Popup and icon switch does not work

拜拜、爱过 提交于 2019-12-17 21:28:52
问题 While using a default popup for my Chrome extension, I can't change the icon for the state of the extension. If I disable the popup.html the state changing icons are working. I used a toggle method for changing the icons, which worked perfectly before without using the popup.html. How is that possible? Can anyone help me please? thanks in advance! 回答1: When you have a popup set, chrome.browserAction.onClicked is not fired . You will need to message your extension's background page from the

Where to find extensions installed folder for Google Chrome on Mac?

∥☆過路亽.° 提交于 2019-12-17 21:26:55
问题 I can not find them under ~/Library/Application Support/Google/Chrome/; Where are they? Mac Pro 10.8.4 Chrome Version 26.0.1410.65 回答1: The default locations of Chrome's profile directory are defined at http://www.chromium.org/user-experience/user-data-directory. For Chrome on Mac, it's ~/Library/Application\ Support/Google/Chrome/Default The actual location can be different, by setting the --user-data-dir=path/to/directory flag. If only one user is registered in Chrome, look in the Default