Skip to content
Advertisement

chrome.runtime is undefined when extension installed from chrome store

When i console.log(chrome) with google chrome browser i get certain properties but i find the ‘runtime’ property of chrome is not available. so chrome.runtime is undefined. and hence i am not able to use chrome.runtime.sendMessage for my extension How to resolve the above?? EDIT : my code is : EDIT 2 : from here : https://developer.chrome.com/docs/extensions/mv3/manifest/externally_connectable. I am sure(correct me

How to print pdf.js document?

I’ve generated a document with pdf.js and it shows correctly. I’don’t have print button. How to add the button to allow users to print it ? I was using Chrome. Answer Try using the javascript-function window.print();, which opens the print-dialog. You will have to add an button to your html, which triggers the command – its not possible within the

How to add rooms in Node.js with Socket.io?

I have been following up many articles to learn making chat application with Node.js and Socket.io. Everything is clear and I can make an application moving messages from client to server and emitting to all etc but only one thing is not clearing and cannot figure this out. How can I add rooms to io.sockets.manager.room? What is the code to

Advertisement