google-chrome-extension

Is there an alternative to preprocessorScript for Chrome DevTools extensions?

本秂侑毒 提交于 2020-01-13 12:00:14
问题 I want to create a custom profiler for Javascript as a Chrome DevTools Extension. To do so, I'd have to instrument all Javascript code of a website (parse to AST, inject hooks, generate new source). This should've been easily possible using chrome.devtools.inspectedWindow.reload() and its parameter preprocessorScript described here: https://developer.chrome.com/extensions/devtools_inspectedWindow. Unfortunately, this feature has been removed (https://bugs.chromium.org/p/chromium/issues/detail

`Manifest file is invalid` when uploading my chrome extension to the Chrome Web Store

假装没事ソ 提交于 2020-01-13 09:57:07
问题 I have been developing a chrome extension locally. I just finished it and wanted to upload it to the Chrome Web Store. When I uploaded it and it told me: An error occurred: Invalid manifest. If your manifest includes comments, please remove them as our gallery does not support them yet. I checked the JSON to make sure it it was valid and as far as I can tell it is fully valid. I tried naming it differently and uploading it and it still didn't work. I also tried changing the encoding and that

How to replace short (less than a minute) setTimeouts in Event Page Extensions

若如初见. 提交于 2020-01-13 09:16:10
问题 The documentation about transitioning from background persistent extensions to non persistent Event Pages, states: If your extension uses window.setTimeout() or window.setInterval(), switch to using the alarms API instead. DOM-based timers won't be honored if the event page shuts down. Fair enough, but the alarms API documentation states: when can be set to less than 1 minute after "now" without warning but won't actually cause the alarm to fire for at least 1 minute. So, i have a short

How to insert content script in google chrome extension when page was changed via history.pushState?

让人想犯罪 __ 提交于 2020-01-13 09:10:52
问题 I'm creating a small google chrome extension for website, and I want to change some html on particular pages. The problem is that website load his content via ajax, and heavy use history.pushState API. So, I added this thing to manifest: "content_scripts": [ { "matches": ["http://vk.com/friends"], "js": ["js/lib/jquery.min.js", "js/friends.js"], }, ] Everything works fine when I'm opening page first time or reloading it. But when I'm navigating between website pages, chrome don't insert my

How to use Google +1 in a content script without Content Security Policy error?

不想你离开。 提交于 2020-01-13 06:54:08
问题 I'm trying to build chrome extension that uses +1 google api. My manifest.json looks like: "manifest_version": 2, "content_security_policy": "script-src 'self' https://apis.google.com; object-src 'self'", ... "matches": ["http://demosite.com/*"], "js": ["js/jquery.js","js/social/plusone.js"] As you can see I've whitelisted apis.google.com. My plusone.js looks like: var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text

How do I get Facebook's new OAuth 2.0 access_token with JavaScript in Google Chrome Extention?

末鹿安然 提交于 2020-01-13 06:11:52
问题 I want to create simple Google Chrome extention which would display News from Facebook. News feed can be retrieved by calling this: https://graph.facebook.com/me/home? access_token =... But I need access_token . Could someone give a hint how to define a JavaScript function which would return access_token when given YOUR_APP_ID. This function also should work inside Chrome Extention. Other examples on the internet did not work, because: I don't have a server. FB.getLoginStatus does not seem to

Jquery AJAX Post: 500 (Internal Server Error)?

大兔子大兔子 提交于 2020-01-13 05:50:12
问题 I am trying post a string to web service but I am getting this error (Google Chrome Extension Project): jquery-2.1.1.min.js:4 POST http://localhost:49242/Service.asmx/test 500 (Internal Server Error) Here is my ajax code: var data = {}; data.param1 = words[0]; $.ajax({ data: JSON.stringify({ 'data': data.param1 }), dataType: 'application/json', url: 'http://localhost:49242/Service.asmx/test', type: 'POST', contentType: 'application/json; charset=utf-8', success: function (result) { alert

Issues with Content Menu and Opening Tabs - Chrome Extension

偶尔善良 提交于 2020-01-13 05:17:49
问题 im having issue with the below code not showing up with selection is detected on the webpage. Currently when i am selecting text the context menu is not showing up. Code function getword(info,tab) { if (info.menuItemId == "google") { console.log("Google" + info.selectionText + " was clicked."); chrome.tabs.create({ url: "http://www.google.com/search?q=" + info.selectionText, }) } else { console.log("Bing" + info.selectionText + " was clicked."); chrome.tabs.create({ url: "http://www.bing.com

Issues with Content Menu and Opening Tabs - Chrome Extension

牧云@^-^@ 提交于 2020-01-13 05:17:23
问题 im having issue with the below code not showing up with selection is detected on the webpage. Currently when i am selecting text the context menu is not showing up. Code function getword(info,tab) { if (info.menuItemId == "google") { console.log("Google" + info.selectionText + " was clicked."); chrome.tabs.create({ url: "http://www.google.com/search?q=" + info.selectionText, }) } else { console.log("Bing" + info.selectionText + " was clicked."); chrome.tabs.create({ url: "http://www.bing.com

How do I use `jpm` with webextension in Firefox?

人走茶凉 提交于 2020-01-13 03:15:47
问题 I'm starting a Firefox addon and from what I see: jpm is the tool to manage a Firefox addon ; WebExtensions are a new way to write Firefox extensions compatible with the extension API supported by Google Chrome and Opera ; yet I can't find if jpm is usable with WebExtensions. Question Is it possible to develop a WebExtensions using jpm ? 回答1: Nope. They’re two separate ways of developing Firefox add-ons. Just to add a little more detail, if you’re writing an add-on you want people to use now,