google-chrome-extension

How to add a button to play YouTube video full screen using JavaScript?

六眼飞鱼酱① 提交于 2020-01-03 17:52:27
问题 I'm coding a Google Chrome extension where I embed a YouTube video: <iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/M7lc1UVf-VE" frameborder="0" allowfullscreen> I then added a button below that should allow a user to click to play this video in full screen: <a href="#" id="lnkFullScreen">Play full screen</a> The work is done via JavaScript (and jQuery) using the code I found here: $("#lnkFullScreen").click(function(e) { e.stopPropagation();

How to implement logging functionality in a chrome extension

倾然丶 夕夏残阳落幕 提交于 2020-01-03 17:09:37
问题 I'm working on an extension and have a need for logging -- not as in console-based logging, but in the traditional sense of a logfile (the extension monitors for certain events and logs them to the filesystem). First, I tried the filesystem API calls. In general this seems to be the right API, but the issue is that I need to provide the OS-level path to the generated log file to the user of my extension, and I can't see a way to do that. I can find the physical sandboxed file (in ~/Library

Can't load facebook js sdk from Chrome extension

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-03 17:04:16
问题 I'm trying to use facebook sj sdk in a Chrome extension. Im doing this on my extension init: window.fbAsyncInit = function() { // init the FB JS SDK FB.init({ appId: 'APP_ID', // App ID from the App Dashboard //channelUrl : '//www.example.com/', // Channel File for x-domain communication status: true, // check the login status upon init? cookie: true, // set sessions cookies to allow your server to access the session? xfbml: true // parse XFBML tags on this page? }); // Additional

Google Chrome extensions document.title not working

六月ゝ 毕业季﹏ 提交于 2020-01-03 16:58:38
问题 here is the code in the manifest.json { "name": "Page Title changer", "version": "1.0", "description": "Change the <title></title> of a page", "browser_action": { "default_icon": "icon.png" }, "content_scripts": [ { "matches": ["http://*/*"], "js": ["changetitle.js"] } ] } and here is the code from the changetitle.js file chrome.browserAction.onClicked.addListener(function() { document.title = 'new page title'; }); i don't understand why it isn't working, i checked the google code docs while

PUT request in Chrome Extension using Google API not rendering

房东的猫 提交于 2020-01-03 16:44:49
问题 I'm stuck at this point of my code wherein I have successfully called the Sheets API using PUT request, but it's not rendering on the Google Sheet. Here is my code where I use both PUT and GET requests to see if the data changed: background.js chrome.identity.getAuthToken({ 'interactive': true }, getToken); function getToken(token) { console.log('this is the token: ', token); var params = { "range":"Sheet1!A1:B1", "majorDimension": "ROWS", "values": [ ["Hi","Crush"] ], } let init = { method:

How can I add a click for pageAction?

余生长醉 提交于 2020-01-03 13:35:23
问题 First extension—please be kind. My objective is to offer an option when a user visits pages from a particular domain to offer an option to launch another page which uses part of the visited page's domain name as a variable. This code below does what I want but it doesn't offer the action as an option—it just executes. When a page that matches the domain is visited it adds an icon to the address bar. I want the new page called to loaded only when the user clicks on that icon. If that's not

Content Scripts CSS doesn't overwrite the original

我与影子孤独终老i 提交于 2020-01-03 12:29:31
问题 My problem that I want to modify a style of a site with my custom settings. I tried with Content Scripts, but this dosent work, because they can't overwrite the original css files. Here is an example: foo/manifest.json { "name": "test", "version": "1.0", "content_scripts": [ { "matches": ["file://*/*test.html"], "css": ["main.css"] } ] } foo/main.css body { background: #0f0; } test.html <html> <head> <title>foobar</title> </head> <body style="background:#f00;"> </body> </html> Then i loaded

Intercept DNS request in a Chrome Extension?

五迷三道 提交于 2020-01-03 08:39:50
问题 If I want to test http://www.domain.com, but I want to test two versions of it by switching the IP out (e.g. one resolves to 127.0.0.1 and the other 192.168.1.200) is it possible to write/use a chrome extension to handle intercepting the DNS query and resolving to my IP of choice? The current workaround is to utilize the hosts file and flush the DNS cache to switch between them but that's less than optimal and was hoping a browser extension could handle the same thing. 回答1: There's no

Chrome Extension: Programmatically inspect element and “copy xpath” or “copy css path” [closed]

六眼飞鱼酱① 提交于 2020-01-03 06:03:21
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I want to know if it's possible to programmatically access an element, say the current element I am hovering over, and perform the equivalent of right clicking it, going to "inspect element", selecting it in the Elements tab, right click "copy xpath" or "copy css path".

Chrome Extension: Programmatically inspect element and “copy xpath” or “copy css path” [closed]

丶灬走出姿态 提交于 2020-01-03 06:02:04
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I want to know if it's possible to programmatically access an element, say the current element I am hovering over, and perform the equivalent of right clicking it, going to "inspect element", selecting it in the Elements tab, right click "copy xpath" or "copy css path".