google-chrome-extension

How to force loading images for the webpages installed “lazy load” without scrolling?

て烟熏妆下的殇ゞ 提交于 2021-02-10 11:54:38
问题 I implement a Chrome extension. The extension needs to get all images URLs of webpages. However, some webpages have "lazy load" plug-in. My question is if it is possible that I can still get URLs without required manually scrolling down? 回答1: Many of the lazy-load plugins stores the actual URL in the data-* section. When scrolling down, right before the image tag gets into view the data-* content is set on the src attribute to start loading the image. You can iterate through all the image

How to force loading images for the webpages installed “lazy load” without scrolling?

China☆狼群 提交于 2021-02-10 11:54:11
问题 I implement a Chrome extension. The extension needs to get all images URLs of webpages. However, some webpages have "lazy load" plug-in. My question is if it is possible that I can still get URLs without required manually scrolling down? 回答1: Many of the lazy-load plugins stores the actual URL in the data-* section. When scrolling down, right before the image tag gets into view the data-* content is set on the src attribute to start loading the image. You can iterate through all the image

how to get the Callback from chrome.runtime.sendMessage in Angular 4?

别来无恙 提交于 2021-02-10 06:26:31
问题 I am really new working with Angular 4 and Chrome Extensions, but I have this code to comunicate my app in Angular with the Chrome extension. Code in Angular 4. public myObjectExtension : any; public getObjectChrome(){ chrome.runtime.sendMessage(extensionID, 'getObject', function(response) { console.log(response); this.myObjectExtension = reponse; }); } and I have this in my Chrome Extension. chrome.runtime.onMessageExternal.addListener( function(request, sender, sendResponse) { if(request ==

How to use react setState with chrome API

谁说胖子不能爱 提交于 2021-02-09 14:47:08
问题 I want to use react's setState with chrome API but I'm running into an issue... componentDidMount() { chrome.runtime.onMessage.addListener(function(request, sender) { if (request.action == "getSource") { this.setState({sourceCode: request.source}); } }); } I tried the following but chrome API does not recognize setState as a function, so then I tried to first save request.source as a variable... componentDidMount() { var source = ""; chrome.runtime.onMessage.addListener(function(request,

How to use react setState with chrome API

狂风中的少年 提交于 2021-02-09 14:39:33
问题 I want to use react's setState with chrome API but I'm running into an issue... componentDidMount() { chrome.runtime.onMessage.addListener(function(request, sender) { if (request.action == "getSource") { this.setState({sourceCode: request.source}); } }); } I tried the following but chrome API does not recognize setState as a function, so then I tried to first save request.source as a variable... componentDidMount() { var source = ""; chrome.runtime.onMessage.addListener(function(request,

Can Chrome content and background scripts share access to blob: URLs?

有些话、适合烂在心里 提交于 2021-02-09 11:52:59
问题 I'm creating a getUserMedia stream in a Chrome extension content script, and I'd like to pass it to the background script. You can't pass non-JSON'able data between them, so my strategy is to pass instead the generated blob URL to the stream. Content script: function get_stream() { navigator.mediaDevices.getUserMedia({video: 1}).then(stream => { chrome.runtime.sendMessage({action: 'got_stream', params: {stream_url: URL.createObjectURL(stream)}}); }); Background script: chrome.runtime

How do I launch a frameless window from a Google Chrome extension?

喜你入骨 提交于 2021-02-09 10:31:51
问题 I'm looking to achieve something similar to Bitly's Chrome Extension. It's not exactly frameless but the style of the title bar is minimal. Also, unlike other types of windows, in Mac OS you can maximize the main browser window and spawn Bitly's window on top. Neither window.open nor chrome.windows.create offer any options to remove the frame of a launched window. And when these windows are spawned from a fullscreen browser window (maximized) they are also maximized and cannot be used on top

How do I launch a frameless window from a Google Chrome extension?

∥☆過路亽.° 提交于 2021-02-09 10:27:51
问题 I'm looking to achieve something similar to Bitly's Chrome Extension. It's not exactly frameless but the style of the title bar is minimal. Also, unlike other types of windows, in Mac OS you can maximize the main browser window and spawn Bitly's window on top. Neither window.open nor chrome.windows.create offer any options to remove the frame of a launched window. And when these windows are spawned from a fullscreen browser window (maximized) they are also maximized and cannot be used on top

Change navigator.platform on Chrome, Firefox, or IE to test OS detection code

陌路散爱 提交于 2021-02-09 06:54:51
问题 How can I spoof the value of navigator.platform on Chrome, Firefox, or Internet Explorer (preferably Chrome)? It looks like it used to be possible on Firefox natively but that support was dropped for that. This is to test some code on a site which runs in a conditional JavaScript check which tests the navigator.platform property. Unfortunately it's not testing userAgent which would be easy to change. I tried writing a simple chrome extension per the suggestion in the second post on https:/

Code injection using executeScript never call callback in Chrome extension

送分小仙女□ 提交于 2021-02-08 11:47:18
问题 I am trying to create Chrome extension I am creating (intended to automatic fill form on third-party site - I know what you thought, not for spam, no). So when I am trying to inject JS into this page using executeScript it never calls callback function. Here is the code: function doStepPopup () { console.log ("Step "+step+" begins"); debugger; var tab = curTab; chrome.tabs.executeScript (null, { file: "extfiller.js" }, function () { debugger; console.log ("Script injected for step "+step); ..