google-chrome-extension

Detect Youtube video change with injected javascript

天涯浪子 提交于 2020-01-02 02:25:31
问题 I am building an extension (some injected js) that adds some buttons to a youtube page, which works fine. My issue is that when a user clicks on another video (say in the right hand side list), the next video is loaded without an actual page reload. Is there any way to detect this change so that I can rerun my code? I have already tried things like binding to the hashchange event, to no avail. 回答1: The idea is simple: Use background.js to listen for url changes to a specific youtube tab using

Chrome Extension - Invalid Package. Details:Can't unzip the extension

喜夏-厌秋 提交于 2020-01-02 01:47:24
问题 I worked on a chrome extension and uploaded it to chrome webstore and everything went well, I installed it on my Mac and on my Ubuntu machines in chrome it worked fine and installed. But when I try it on Windows machines, after download it popups a error message saying "Invalid Package, Can't unzip the extension". Can any one tell me why or what might be the cause for this OS specific issue. Does it have anything to do with the permission or anything with respective folder name or content?

How to package Firefox and Chrome extensions

馋奶兔 提交于 2020-01-01 20:55:12
问题 I am new to Firefox and Chrome extension development. I have downloaded and tested helloworld sample extension in both FF and Chrome in development mode. Followed the following steps to work properly in FF and chrome, In FF Extracted the sample extension, and added one file in /mozilla/firefox/dev_user/helloworld@mozilla.doslash.org and given extracted folder path. My FF version is 12.0 and I changed the <em:maxVersion> to 12.0.* in install.rdf file. Restarted FF and tested, it worked fine.

Chrome extension run Javascript on X next tabs

我们两清 提交于 2020-01-01 20:25:15
问题 I'm making an extension and I can't understand how to do the following - My extensions currently open X amount of tabs, according to a specific text. Now I want it to run a specific script in every new tab it opens. Manifest.json: { "name": "Asaf Feedback Opener", "version": "1", "manifest_version" : 2, "description": "Opens any View Item on the current page", "background" : { "scripts" : ["background.js"] }, "browser_action": { "default_icon": "icon.png" }, "permissions": ["activeTab", "tabs

Using chrome.downloads.download, is it possible to make the file not popup the download bar?

你离开我真会死。 提交于 2020-01-01 19:43:16
问题 When I executed chrome.downloads.download, it downloads the file and popups up the download bar at the bottom and shows it, can I suppress it? Example: /* some code to suppress download bar */ chrome.downloads.download( { "url": request.ImageToDownload }, function (downloadId){ // ... } ); 回答1: Yes, it's possible. You can fully suppress the download bar: chrome.downloads.setShelfEnabled(boolean enabled) Enable or disable the gray shelf at the bottom of every window associated with the current

Chrome Extension: webRequest Redirect to Existing Tab, Without Opening New Tab

假如想象 提交于 2020-01-01 19:07:15
问题 When a user opens a certain page, I want to open that page in an existing tab, before a new tab is opened. I've tried with webRequest: chrome.webRequest.onBeforeRequest.addListener( function(details) { chrome.tabs.query({ url: 'https://example.com/' },function (tabs) { chrome.tabs.update(tabs[0].id, { url: details.url, highlighted: true }); }) }, {urls: ['https://example.com/']}, ['blocking'] ); I've also tried with webNavigation: chrome.webNavigation.onBeforeNavigate.addListener(function

pass input file to background script

☆樱花仙子☆ 提交于 2020-01-01 15:04:23
问题 I want to pass the input file from content page to extension background script, and then load it with FileReader() in the extension background script. So in the web page I have a <input type="file"> and from onchange event I pass the file from content script to background page like this: var myfile = document.getElementById('fileid').files[0]; chrome.runtime.sendMessage({myevent: "start", inputfile: myfile}, function(response) {}); in the background script I have this: chrome.runtime

Chrome plugin - Permission chrome-devtools://*/* is unknown or URL pattern is malformed

旧城冷巷雨未停 提交于 2020-01-01 13:26:51
问题 I am maintaining one extension for google chrome and I'm receiving complaints from random users saying that it just stopped working. The error message in "extensions" section is this: Chrome plugin - Permission chrome-devtools://*/* is unknown or URL pattern is malformed It seems it's not a very popular issue - I wasn't able to find any trace of that. My permissions section of the manifest file looks like this: "permissions": [ "tabs", "http://*/*", "https://*/*", "chrome-devtools://*/*" ]

AngularJS from a Chrome Extension background script

帅比萌擦擦* 提交于 2020-01-01 12:25:28
问题 Given that Angular is tied to the views and bootstrapped in the main extension view, I assume the simple answer is "No, not possible", but wanted to confirm as I can't find a definitive answer anywhere. My use case is that the extension will be polling for updated content from an API, and updating the extension's badge when found; I'd love to be able to re-use my API service from the extension's Angular codebase. If not possible, any suggested workarounds for sharing code between the Angular

chrome extension to access content of downloaded files

為{幸葍}努か 提交于 2020-01-01 11:59:29
问题 I'm working on a Chrome extension and I'd like to have the extension: Click on a link to initiate a file download Once the download is complete, open and read the contents of the downloaded file Do something with the contents of the file in JavaScript I see that the chrome.downloads API allows me to initiate the download and open the file, but is it possible for me to read the contents of the file (without writing native code)? 回答1: I'm copying the answer I gave here. You just need to add a