Posts

Showing posts with the label google-chrome-devtools

sending message to chrome extension from a web page

Image
sending message to chrome extension from a web page I want to send message from the console of the random web page to my chrome extension. chrome.extension.sendMessage doesn't seem to work. 5 Answers 5 According to the official docs you should use postMessage in the sender and message event listener in the receiver. postMessage message Here is an example: Your website's page.html var data = { type: "FROM_PAGE", text: "Hello from the webpage!" }; window.postMessage(data, "*"); Content script: (injected using chrome.tabs.executeScript(tabid, {code:... ) chrome.tabs.executeScript(tabid, {code:... window.addEventListener("message", function(event) { // We only accept messages from ourselves if (event.source != window) return; if (event.data.type && (event.data.type == "FROM_PAGE")) { console.log("Conten...

“Debugging connection was closed: Render process was gone”, when trying to download a 7gb from cdn

“Debugging connection was closed: Render process was gone”, when trying to download a 7gb from cdn We are trying to download a 7 GB from CDN using JSZip.js. The chrome browser suddenly seems to close the connection when the download reaches 3.5gb every time. The approximate time is around 15 mins. Is there a way we increase the tolerant time to 1 hr say? $("#downloadJSZip").on('click', function () { var result = [{ "cdn": "url....", "filename": "7.84 gb.zip", "size": 4194304, "path": "7.84 gb" }]; var Promise = window.Promise; if (!Promise) { Promise = JSZip.external.Promise; } function urlToPromise(url) { return new Promise(function(resolve, reject) { JSZipUtils.getBinaryContent(url, function (err, data) { ...