google-chrome-extension

Chrome extension tabs onUpdated event

删除回忆录丶 提交于 2020-01-14 20:41:45
问题 I am building a chrome extension that should get notified every time a new tab has opened and load page, and for that purpose I'am using chrome.tabs.onUpdated event. The problem is that in case an iframe is inserted on that page/tab that is hosted on some domain(has src), onUpdated event is trigered. Is there a way to differentiate these events for "real" tab load from those triggered for iframe load? 回答1: tabs.onUpdated triggers when state changes between loading to complete . Presumably,

Make element not affected by CSS rules

喜欢而已 提交于 2020-01-14 14:58:32
问题 My google chrome extension needs to wrap content of certain elements on page user is browsing into custom element, say, <xelem>original content</xelem> . This change should not make any visible effect. Is it possible to make <xelem> NOT affected by * css rules (or any other rules that might apply to it), but at the same time retain inherited styles? 回答1: Considering you are working with css3, have a look at the :not pseudo-class. Something like :not(xelem) { /* ... */ } should work... 来源:

Function not defined creating a Chrome Extension Content Script

前提是你 提交于 2020-01-14 14:12:10
问题 I'm writing a Chrome content script and when I inject this in the DOM: "<a href='#' onclick='alert(\"Hi!\");return false;'>Hi</a>" it works fine (the alert pops up when I click it), however if I create a function for the alert, it will say function undefined. Ex: "<a href='#' onclick='alertPlease(\"Hi!\");return false;'>Hi</a>" function alertPlease(x){ alert(x); } All my code is the same content script js file. Do I have to place whatever code that can be used after loading in another js file

Function not defined creating a Chrome Extension Content Script

醉酒当歌 提交于 2020-01-14 14:12:05
问题 I'm writing a Chrome content script and when I inject this in the DOM: "<a href='#' onclick='alert(\"Hi!\");return false;'>Hi</a>" it works fine (the alert pops up when I click it), however if I create a function for the alert, it will say function undefined. Ex: "<a href='#' onclick='alertPlease(\"Hi!\");return false;'>Hi</a>" function alertPlease(x){ alert(x); } All my code is the same content script js file. Do I have to place whatever code that can be used after loading in another js file

Chrome extension on an extension?

China☆狼群 提交于 2020-01-14 13:44:08
问题 Is it possible, even in a hacky way, to make a chrome extension for an already existing extension? Or to monkey patch an existing extension? I wish to make some simple usability changes to a non-open source chrome extension. 回答1: Chrome extensions can't access the internal pages of other extensions which have chrome-extension:// address (toolbar popup, page action popup, options page, background page), nor access the content scripts of other extensions. The only case where it's possible to

Google Docs - programmatically send mouse click to an item in outline pane

て烟熏妆下的殇ゞ 提交于 2020-01-14 13:09:24
问题 In Google Docs you can open outline pane and see all headers in the document, you can also click on an header and the view will scroll to header. My question is how simulate mouse click programmatically with JS in Chrome extention, to scroll the view to the desired header? I tryed following code but nothing hapend: // usage: eventFire(document.getElementById('mytest1'), 'click'); function eventFire(el, etype) { if (el.fireEvent) { el.fireEvent('on' + etype); } else { var evObj = document

Chrome Extension stalls in “Publishing in progress”

六月ゝ 毕业季﹏ 提交于 2020-01-14 10:46:49
问题 I have successfully uploaded Test (exposed only to tester accounts) / Production versions of our Google Chrome Extension using my developer account. The problem appeared after trying to migrate our Chrome Extensions to a newly created Google Group (so as to enable collaboration for publishing different versions etc). Now, every new version we are trying to publish stalls in "Publishing in progress" mode. Any ideas on why this error started and how we could overcome it? 回答1: Usually it shouldn

How to load Google Analytics and Facebook SDK in chrome extension?

风流意气都作罢 提交于 2020-01-14 09:52:09
问题 I'm developing a chrome extension using Kango framework, and I waned to use both Google Analytics and facebook SDK. I edited the manifest file to include the follwoign "content_security_policy": "script-src 'self' https://ssl.google-analytics.com https://connect.facebook.net; object-src 'self'; default-src 'self' 'unsafe-eval' chrome-extension-resource: https://*.facebook.net https://*.facebook.com; style-src 'self' 'unsafe-inline' chrome-extension-resource: https://*.facebook.net https://*

Chrome web-store not displaying my extension in search result

半腔热情 提交于 2020-01-14 07:51:25
问题 Yesterday I published my chrome extension to public with title and name as 'Bumpy'. But I couldn't able to find it in chrome web store when searched with same name. Please let me know, if someone has faced the same issue and right approach to resolve it. 回答1: It usually takes some time (more than a day or so from past experience) for the Chrome web store to index newly accepted extensions. Unless there's a specific outage, it should show up soon. If you don't see start seeing it within in a

How to always allow Chrome plugins in command line

血红的双手。 提交于 2020-01-14 06:22:07
问题 I want to always allow my NPAPI plugin in Chrome. I find in page "Chrome://plugins" , there is a checkbox "Always Allowed" for each plugin. Now I want to make one plugin "Always Allowed" without clicking that check box, so how can I achieve this? Is there any command arguments for this? 回答1: All, or at least most, Chrome/Chromium command line switches are listed on this page: http://peter.sh/experiments/chromium-command-line-switches/. It is generated from Chromium source and contains links