google-chrome-extension

chrome apps- content security policy - jquery datepicker() not working

被刻印的时光 ゝ 提交于 2019-12-24 13:15:07
问题 i tried this : <div id="d1"> sampletext </div> $("#d1").datepicker(); when i run above code, it is showing datepicker , but without any formatting like good background and others, why ? Also , after i click on any date in the date picker, getting the error Refused to execute inline event handler because of Content-Security-Policy. what should i do to make this work ? or, if there is any solution that i can use without using this datepicker, plz tell me so that i will use it , thanks ! 回答1:

Remove a “onmousedown” event from a DOM element via content script in Google Chrome extension

那年仲夏 提交于 2019-12-24 12:24:39
问题 I'm trying to write a Google Chrome extension that removes the onmousedown event from a <a> tag on a website. Earlier that site used to have onmousedown event as part of the DOM so I could easily remove it via content script by calling element.removeAttribute("onmousedown") . But now, they add that event via javascript so it's not possible for me directly remove that event via content script as it runs in a different javascript context. PS: I'm specifically talking about onmousedown event on

Chrome extension: context menu for video doesn't work

不想你离开。 提交于 2019-12-24 10:52:55
问题 I'm trying to create a context menu item with "contexts":["video"] with no luck. The item just doesn't show up when I right-click on a video. So I tried to download this official example and I was surprised to see that all its context menu items where shown as expected except for the video one! Can anyone provide me an explanation as for what am I missing? I haven't uploaded any code since the full example I mentioned can be found in its place, this code is supposed to work more than any of

Message passing in Chrome Extension

一个人想着一个人 提交于 2019-12-24 10:49:04
问题 I am quite confused about the what are counted as chrome extension view, which directly linked to what function I can use for passing messages between different components. Let me just describe what I am trying to do first; My background.html creates Desktop Notifications based on some events received from a node.js server through socket.io. When the user clicks on the notification, I want to create a new tab pointing to a html within my extension (/src/view/token.html), and then send some

Initiate a click event in a twitter chrome extension

ぃ、小莉子 提交于 2019-12-24 10:48:18
问题 I try to initiate a click event on Twitter's .com web page. But somehow it doesn't work when I try the code in my extension. if(typeof TIP == 'undefined'){ var TIP = {}; } TIP.Tweets = { getNumberOfTweets: function(){ var tweets = $('#stream-items-id .js-stream-item').length; return tweets; }, setNumberOfTweets: function(number){ TIP.Tweets.currentNumberOfTweets = number; } } TIP.initiate = function(){ TIP.Tweets.currentNumberOfTweet = TIP.Tweets.getNumberOfTweets(); setInterval(function(){

Runtime error on chrome extension

核能气质少年 提交于 2019-12-24 10:48:00
问题 Premise: Trying to write an incredibly simple chrome extension, and as a test, I wanted to add console logging for debugging. But, I keep getting this error Unchecked runtime.lastError while running webRequestInternal.addEventListener : You need to request host permissions in the manifest file in order to be notified about requests from the webRequest API. Attempted: I have tried adding every permission I can find without any luck. Could someone please help me out! Manifest File: { "manifest

Ready-to-use NPAPI-Plugin to launch external application?

↘锁芯ラ 提交于 2019-12-24 09:28:24
问题 I need to launch an external application from a Google Chrome extension. I need to pass a few parameters from javascript, wait until the external application is done and then use its output in javascript. I did some reading and this should be possible using an NPAPI plugin (I only care about Windows so far). Since my C/C++ got very rusty over the years and my requirements are quite simple I was wondering if somebody knows about a ready-to-use NPAPI DLL that does just the one thing I need:

XMLHttpRequest in Chrome locks up browser

雨燕双飞 提交于 2019-12-24 09:28:00
问题 I have the following code (I don't recommend running it): let req = new XMLHttpRequest(); req.open('GET', 'https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=' + token); req.onload = function() { console.log('response:', req.response); }; req.send(); What happens is this opens up a new tab, and this tab completely steals all the focus. I can't use any of the other Chrome tabs, it quickly switches back to the auth tab. And if I log-in with the auth tab, it just reloads the

Force Proxy re-authentication in Chrome Extension

别等时光非礼了梦想. 提交于 2019-12-24 08:25:44
问题 I'm making an extension which allows users to store proxy servers with auth credentials (user/pass) and switch between servers. I am listening for the webRequest.onAuthRequired event and when the server challenges for auth, proving the username/password the user has saved, as per the provideCredentialsSync example here: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onAuthRequired#Examples The problem is that when these credentials are provided, they

Chrome extension to replace html words

試著忘記壹切 提交于 2019-12-24 07:53:01
问题 I am looking to create a google extension that will allow me to replace a specific word in a sites html. Ex: replace the word "hidden" with "shown". I am not trying to change page text, just the html. I would like to make it a toggle type extension that I can use when needed. Thank you to anyone who can help me. 回答1: You may want to refer with this blog tutorial. Here's a sample code of how to replace a specific text into another word. var elements = document.getElementsByTagName('*'); for