google-chrome-extension

How to get Google Plus Notifications count?

霸气de小男生 提交于 2019-12-24 03:31:33
问题 I'm developing a Google Chrome extension and I want to retrieve Google+ notifications count for current user, in a script running in the background. Is it possible? I studied the Google+ APIs at https://developers.google.com/+/api/ but it seems not supported yet. How is it possible to retrieve the count value anyway? I tried with a (cross-domain permitted) AJAX request, but the notification value seems generated at runtime, in JavaScript. 回答1: You're correct that there's no way to access the

How can I make the variable newUser defined inside a function global?

可紊 提交于 2019-12-24 03:29:49
问题 I send the variable newUser from options.html to background.html with chrome.extension.getBackgroundPage() like this document.getElementById("save").addEventListener( "click", function () { var newUser = document.getElementById("getEmail").value; var bkg = chrome.extension.getBackgroundPage(); bkg.saveNewUser(newUser); console.log("newUser " + newUser); } , false) In background.html I have function saveNewUser (newUser) { newUser = newUser; //this should be global? console.log("newUser from

How do I use YUI3 in a Chrome extension?

痞子三分冷 提交于 2019-12-24 02:58:27
问题 If I download the minified YUI3 loader and include it in my background.html I get the following error: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' chrome-extension-resource:". Can YUI3 be used in an extension? 回答1: It looks like it's blocking you from using eval(). Make sure you have the following line in your manifest. "content_security_policy":

Can a Chrome extension content script make an jQuery AJAX request for an html file that is itself a part of the Chrome extension?

大兔子大兔子 提交于 2019-12-24 02:38:06
问题 I am working on a Chrome extension content script that will, on specific pages, inject additional content onto the page to add functionality to an existing site. I have an HTML file that is in my Chrome extension that contains the template for content that will be added. I am hoping I can use jQuery to retrieve that HTML template. I initially tried a simple jQuery AJAX request, like this: var url = "template.html"; $.get(url,function(data, textStatus, jqXHR){ console.log("Got the template!");

Text gets set in Google Groups, post-message body but does not display?

南笙酒味 提交于 2019-12-24 02:34:16
问题 My extension, in a content script, writes to the subject and message body of the Google Groups "New Topic" page. The updated subject is displayed just fine; it's of input type "text", so everything is easy. The body, however, is a div representing a TextBox, and when I write to it, the update doesn't appear: (Click for a larger image.) I tried setting the focus to the field first, but that had no effect. 回答1: How are you trying to set the text? Show your code! A typical way to initially set a

Chrome extension xhr request getting cancelled

筅森魡賤 提交于 2019-12-24 02:18:20
问题 I am trying to build a chrome extension which uses a xhr request to get response from a external api. I have set the permission for the extension as mention in the chrome extension document still xhr request is getting cancelled in network. manifest.json "browser_action": { "default_icon": "icon.png", "default_popup": "popup.html", "default_title": "Chrome extension title" }, "permissions": [ "activeTab", "storage", "https://*/" ] In popup.js var xhr = new XMLHttpRequest(); xhr.open("GET",

How to make border radius in popup chrome extension?

对着背影说爱祢 提交于 2019-12-24 02:14:05
问题 I'm developing chrome extension, I want to make border radius and use radius border propery in css, but it boder in child elemement. My code html here : <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" style="border-radius:10px"> <head> </head> <body> content here </body> </html> I want border as picture below : http://postimg.org/image/8ct4dcq93/ 回答1: Unfortunately, I don't think you can do it. The frame around the popup page (highlighted in red in a graphics editor) is fully

Handle Relative Image Paths ajax

不羁岁月 提交于 2019-12-24 01:48:11
问题 I'm developing a small Google chrome extension that screen scrapes a certain website. The problem is that because that website uses relative paths the links become broken and I get lots of errors like this: GET chrome-extension://higopdenpioddpmobbehnbcadeenihic/html/images/ico_aAO.gif GET chrome-extension://higopdenpioddpmobbehnbcadeenihic/html/images/ico_dAO.gif Is there any way to avoid these errors? The code I'm using for making the GET call is: $.ajax({ url: searchUrl, type: "GET", data:

Google Chrome - Extension vs App

自古美人都是妖i 提交于 2019-12-24 01:47:32
问题 I want to modify chrome start page, change background and maybe logo. I want to include jQuery in users local storage and load it while users page loads ( search page ) I never done anything with chrome so I want some way where to start. Do I go reading with apps or extensions? 回答1: As a rule of thumb: Choose an app if you want to develop an (independent) application that can stand on its own. If you want to interact with the browser (e.g. modify a web page), build an extension. In your case,

Open chrome.identity.launchWebAuthFlow as a tab (Chrome Extensions)

别等时光非礼了梦想. 提交于 2019-12-24 01:45:15
问题 I am using chrome.identity.launchWebAuthFlow() to direct a user through OAuth2 of a non-Google API when they use my extension. Even though authentication works and I can effectively get the user's authentication token, I dislike that it opens up entirely in a new window that lacks the browser's UIs and a URL bar. Ideally, I would be able to conduct this OAuth dance within the extension's popup window. If that doesn't work, being able to at least have this OAuth event take place in a separate