google-chrome-extension

Chrome extension that overrides SSL certificate error for self-signed certificate?

喜你入骨 提交于 2019-12-13 05:14:13
问题 I am trying to make an ajax request to a trusted test server through chrome extension, which is self signed. so whenever i make a request it provide me Badrequest but it works fine on orignal/main web server. So i need to override the self signed certificate in order to make a successful ajax request. Any help would be appreciated! 来源: https://stackoverflow.com/questions/24084128/chrome-extension-that-overrides-ssl-certificate-error-for-self-signed-certificat

Executing asynchronous function , synchronously

谁说我不能喝 提交于 2019-12-13 04:48:18
问题 I am making a chrome extension that blocks specific sites added to local storage through popup window. I think the problem in this code is, it returns before completion of chrome.storage.local.get's callback. How can I make it wait for sometime before returning ? chrome.webRequest.onBeforeRequest.addListener( function(details) { var matched = false; chrome.storage.local.get ( 'blocked_sites', function ( sites ) { var bsites = sites.blocked_sites; for ( i = 0, size = bsites.length; i < size; i

Google Chrome extension installed popup

一曲冷凌霜 提交于 2019-12-13 04:46:59
问题 While installing the Google extensions form chrome web store it shows some popup like "Google Chrome extension is now installed". I want similarly, while login I need to show the login popup. Please suggest me on this. 回答1: You can create either a browser action or a page action popup. You can change popup html dynamically to make it look completely different depending on the situation but you can't open it programmatically (desktop notifications could be used for alerts). 来源: https:/

How do I debug a Chromium extension?

岁酱吖の 提交于 2019-12-13 04:44:42
问题 I'm trying to debug a Chromium extension with console.log() , but I noticed that nothing is appearing in my JavaScript console. I assume the console object for the extension is not the same console that the document has access to, so how do I dumb a variable into JSON so I can see the result. I'm looking to get something like console.log() with Firebug. 回答1: The default Javascript console does not work for extensions, in order to see the console for the extension, you have to: Right click on

Chrome plugin reading text file on hard drive and replacing textbox content

主宰稳场 提交于 2019-12-13 04:37:24
问题 I'm doing a lot of work where I use sublime to code and then need to copy the contents to a web based "editor" that really sucks. I would like the contents of this textbox/editor to be automatically populated with the contents of a text file that I chose. I don't control the web page that I'm copying code to so can't inject an applet or similar. What I'm hoping to do is to create a plugin (I'm using chrome) with which I can select an element as target, select a text file on the hard drive (or

Change URL on onBeforeRequest

旧街凉风 提交于 2019-12-13 04:20:51
问题 I have following code: chrome.webRequest.onBeforeRequest.addListener( function(details) { return { redirectUrl: "http://yahoo.com"}; }, { urls: [ 'http://google.com' ], types: ['main_frame'] }, ['blocking']); This is redirecting google.com to yahoo.com. My Question is now howto keep google.com in the addressbar, showing yahoo.com. My first attempt was to use chrome.tabs.update(tab.id, {url: details.url}); but that results in an Reloading of the site. WHY? I am requesting this for pdf.js,

image to base64 conversion

孤者浪人 提交于 2019-12-13 04:18:44
问题 I want to convert a images to base64 format for my chrome extension. CODE: var img_src = $('#elementId').attr('src'); converImgToBase64(img_src) function convertImgToBase64(url) { var canvas = document.createElement('CANVAS'); ctx = canvas.getContext('2d'); img = document.createElement('img'), img.src = url; img.onload = function() { canvas.height = img.height; canvas.width = img.width; var dataURL = canvas.toDataURL('image/png'); alert(dataURL); var doc = new jsPDF(); doc.addImage(dataURL,

Chrome Extension: How to pass a variable from Content Script to background.html

北城余情 提交于 2019-12-13 04:12:16
问题 I can't figure out how to pass a variable (or an array of variables) from a content script to a background page. What I'm trying to do is find certain DOM elements with my content script, then send them to my background page so that I can make a cross-domain XMLHttpRequest with them (store them in a database on a different site). My code is below. I know that the variable named "serialize" is not being passed (and I don't expect it to based on my current code but have it in there so it's

Chrome extension: is there a ways to access the $0 (the selected console element) from an extension?

坚强是说给别人听的谎言 提交于 2019-12-13 03:59:08
问题 I am trying to access the $0 (which is the last selected element in the chrome developers tools) for an extension I'm building. Any way to do so? More information: The extension is a page action extension. It has several features and I want to have an option to inquire about the current selected object ($0). Can I keep it as a page extension extension or dof I have to go developer tool plugin way? 回答1: $0 is only meaningful when the developer tools are still activated. The only way to get the

Why webNavigation Listener failed for some websites?

偶尔善良 提交于 2019-12-13 03:50:31
问题 I am trying to use chrome extension to get some data from web of science. In one step, I want to create a new tab and wait until it loaded. So I add a webNavigation Listener after creating the tab. I found the listener works well only for some websites. If I use the target url (web of science) as the code below, I won't get the alert window. But if I use the target "https://stackoverflow.com/questions/ask", it gives the alert successfully. Why this happens? Could anyone advice the reason to