How do I import scripts into a service worker using Chrome extension manifest version 3?

First off, important warnings: Warning: Chrome 92 or older doesn’t show errors occurred in the service worker – it was a bug, fixed in newer Chrome, which now shows the errors in chrome://extensions page. These old versions of Chrome can’t register the background script if an unhandled exception occurs during its compilation (a syntax error … Read more

How to change chrome packaged app id Or Why do we need key field in the manifest.json?

Once uploaded to the Chrome Web Store, your extension ID is fixed and cannot be changed any more. The ID is derived from the .pem file that was created the first time you (or the Chrome Web Store) packed the extension in a .crx file. When you load an extension in “unpacked mode”, an ID … Read more

Refused to execute inline event handler because it violates CSP. (SANDBOX)

Answer for your non sandbox related question: You have something in your code like this: <button onclick=”myFunction()”>Click me</button> In a nutshell this is not allowed in chrome apps and extensions. Change this to the following and it will work: html: <button id=”myButton”>Click me</button> <script src=”https://stackoverflow.com/questions/36324333/script.js”></script> script.js: document.getElementById(“myButton”).addEventListener(“click”, myFunction); function myFunction(){ console.log(‘asd’); } Long story: In … Read more

Difference between Chrome Apps and Extensions

Quoting from https://developer.chrome.com/webstore/apps_vs_extensions: We’ve already had the concept of “web apps” in the browser for a few years, as something more rich and interactive than a website, but less cumbersome and monolithic than a desktop application. Examples include games, photo editors, and video players; all of these categories are viable as tightly focused apps running … Read more

Chrome Extension Message passing: response not sent

From the documentation for chrome.runtime.onMessage.addListener: This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until sendResponse is called). So you just need to add return true; after … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)