Passing message from background.js to popup.js

Popup doesn’t have tab id so you will get the error. You can use chrome.runtime.sendMessage and chrome.runtime.onMessage.addListener in that case. So in background.js chrome.runtime.sendMessage({ msg: “something_completed”, data: { subject: “Loading”, content: “Just completed!” } }); And in popup.js chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { if (request.msg === “something_completed”) { // To do something console.log(request.data.subject) console.log(request.data.content) } … Read more

additional options in Chrome headless print-to-pdf

Add this CSS to the page your creating into a PDF to remove Chrome Headless’s implemented Header and Footer. CSS: @media print { @page { margin: 0; } body { margin: 1.6cm; } } You should format your command like below to create the PDF: “C:\PATH\TO\CHROME\EXECUTABLE\FILE”, “–headless”,”–disable-gpu”,”–print-to-pdf=” + directory path to where you want the … Read more

Iframe in Chrome error: Uncaught SecurityError: Failed to read the ‘sessionStorage’ property from ‘Window’

I had the same problem with localStorage, and fixed it like this : Under Settings > Privacy > Content settings, change the cookies’ settings to “Allow local data to be set” or the second option (in my case, it was previously on “Block sites from setting any data”). Edit On newer Chrome versions, make sure … Read more

Chrome Console SameSite Cookie Attribute Warning

This is something that the third-party cookie setters (like Stripe) need to handle on their end. I reached out to Stripe because I was getting this message for Stripe payments. Stripe support response: It looks like we’re already tracking this internally as this warning comes from Stripe.js, not from react-stripe-elements. For now this is a … Read more

How to keep a flex item from overflowing due to its text? [duplicate]

UPDATE Adding code that works: .container { display: -webkit-flex; } .container>div:first-child{ white-space:nowrap; -webkit-order:1; -webkit-flex: 0 1 auto; /*important*/ text-overflow: ellipsis; overflow:hidden; min-width:0; /* new algorithm overrides the width calculation */ } .container > div:last-child { -webkit-flex: 1; -webkit-order:2; background: red; -webkit-flex:1 0 auto; /*important*/ } .container > div:first-child:hover{ white-space:normal; } <div class=”container”> <div>foo barfoo bar</div> … Read more

Chrome’s remote debugging (USB debugging) not working for Samsung Galaxy S3 running android 4.3

My devices stopped working as Chrome de-activated the now depracated ADB plugin as it’s built in dev-tools now. I downloaded the SDK and followed the instructions at Chrome Developers. How ever I found the instructions served by Alphonso out not to be sufficient and I did it this way on Windows 8: Download Android SDK … Read more