google-chrome-extension

share on facebook from chrome extension

微笑、不失礼 提交于 2019-12-19 10:29:17
问题 I want to share current opened tab url on facebook wall from chrome extension. For that, I was using https://facebook.com/share.php earlier which was giving me login option first and then share box. Since facebook has deprecated this method, how can I post/share on my wall from chrome extension? FB.api is another option but for that I may have to authenticate with facebook first. How can I achieve this from chrome extension? 回答1: You can use feed dialog, find more detail here This is a direct

Chrome native messaging doesn't accept messages of certain sizes (Windows)

被刻印的时光 ゝ 提交于 2019-12-19 10:17:40
问题 I'm developing a Chrome extension working with native messaging host. It works in most cases, but I have found a strange behavior when I send messages of certain sizes. It seems that message is dropped, when the size is between 2560 and 2815 bytes (A00 and AFF in hex). All subsequent messages are also not arriving, which suggests that the stream is corrupted for some reason. Here is a stripped down Python native messaging app, which can be used to test it: import sys import struct def output

Google Chrome Extension - prevent cookie on jquery ajax request or Use a chome.extension

偶尔善良 提交于 2019-12-19 10:14:50
问题 I have a great working chrome extension now. It basically loops over a list of HTML of a web auction site, if a user has not paid for to have the image shown in the main list. A default image is shown. My plugin use a jQuery Ajax request to load the auction page and find the main image to display as a thumbnail for any missing images. WORKS GREAT. The plugin finds the correct image url and update the HTML Dom to the new image and sets a new width. The issue is, that the auction site tracks

How to get selected text in chrome extension development?

匆匆过客 提交于 2019-12-19 09:57:10
问题 I'm developing a chrome extension which involves getting selected text of the current tab. Here is the html file that I use: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> <script> chrome.tabs.executeScript( { code: "window.getSelection().toString();" }, function(selection) { document.getElementById("output").value = selection[0]; }); </script> </head> <body> <div id="output"></div> </body> </html> It doesn't work, why? As followed is the error message from

Override Element.prototype.attachShadow using Chrome Extension

£可爱£侵袭症+ 提交于 2019-12-19 09:56:30
问题 I need to access the DOM of a web component that has a closed Shadow DOM for some Selenium testing. I've read in several references that you can override Element.prototype.attachShadow on the document startup in order to change the Shadow from closed to open. In order to do this, I created a Chrome Extension. Below is my manifest.json : { "name": "SeleniumTesting", "description": "Extension to open closed Shadow DOM for selenium testing", "version": "1", "author": "SeleniumTesting", "manifest

Communication from an injected script to the content script with a response

蓝咒 提交于 2019-12-19 09:09:21
问题 Following this question, communicating between an injected script and content script can be made that way: // Content script window.addEventListener("getChromeData", function(data) { // do Chrome things; }, false); // Injected script window.dispatchEvent(new CustomEvent("getChromeData", {data: 'whatever'})); I wanted to know if there is a way to make use of returned data into the injected script, using a promise or a callback mechanism? 回答1: The communication back is again done with an event.

chrome.extension.getBackgroundPage() returns null after awhile

ぃ、小莉子 提交于 2019-12-19 09:05:58
问题 When my chrome extension loads on chrome startup, everything seems to be ok and chrome.extension.getBackgroundPage() returns the right value (lunched from popup.js). But after awhile (2-3 minutes), especially if the browser is let alone, the function returns null. Only closing and re-opening chrome solves the problem. I tried to manipulate it by: if (chrome.extension.getBackgroundPage() == null) window.location.reload(true); As suggested at Why does chrome.extension.getBackgroundPage() return

Developer Chrome extension: Package is invalid. Details: "Could not uzip extension'

心不动则不痛 提交于 2019-12-19 08:56:46
问题 I have developed a chrome extension. I made some small updates, and suddely the extension can't be installed through chrome web-store. I get the error Package is in valid. Details: 'Could not unzip extension' It appears that there is something wrong with the zip file. As far as i understand when uploading a zip file to chrome web store, it gets encrypted to a crx-file . Could it be a hiccup happening there? When installing the the extension locally through 'load unpackaged extension' or with

Chrome extension mutating running react application

穿精又带淫゛_ 提交于 2019-12-19 08:05:31
问题 i am trying to create extension for chrome which mutating DOM of facebook timeline. Chrome extension cant inject to var or function created by page: https://developer.chrome.com/extensions/content_scripts#execution-environment So its possible change rendering of react app? I was trying manually change text: var elements = document.querySelectorAll('.UFILikeLink'); for (var i = 0; i < elements.length; i++) { var element = elements[i]; element.innerHTML = element.innerHTML.replace(/Like/g,

How to tell if a Chrome extension is installed by a real user vs. by me during development?

孤街醉人 提交于 2019-12-19 07:49:50
问题 I'm using Analytics in my Chrome extension. I want to execute the analytics code only if the extension is being used by a real person (not me while I'm working on it). Are any of the following doable and which is the best? Identify whether the extension was installed packed or unpacked. I think this is the best because unpacked clearly means it's "in development" and it's not specific to my machine in any way. Can the extension know this programatically? Have the extension look for something