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

Using ECMAScript 6

In Chrome, most of the ES6 features are hidden behind a flag called “Experimental JavaScript features”. Visit chrome://flags/#enable-javascript-harmony, enable this flag, restart Chrome and you will get many new features. Arrow functions are not yet implemented in V8/Chrome, so this flag won’t “unlock” arrow functions. Since arrow functions are a syntax change, it is not … Read more

Disable developer mode extensions pop up in Chrome

The official way to disable the popup is this: Pack your extension: go to chrome://extensions, check Developer mode and click Pack extension Install the extension by dragging and dropping the .crx file into the chrome://extensions page. You’ll get an “Unsupported extensions disabled” popup if you try restarting Chrome at this point. Then for Windows 7 … Read more

Is it possible to hide extension resources in the Chrome web inspector network tab?

Not quite the solution I was after (I’d have preferred a global setting), but there is now a way to filter out requests from extensions, as mentioned by a commenter on the issue I originally opened. In the network tab filter box, enter the string -scheme:chrome-extension (as shown below): This is case-sensitive, so make sure … Read more

Chrome extension: accessing localStorage in content script

Update 2016: Google Chrome released the storage API: https://developer.chrome.com/docs/extensions/reference/storage/ It is pretty easy to use like the other Chrome APIs and you can use it from any page context within Chrome. // Save it using the Chrome extension storage API. chrome.storage.sync.set({‘foo’: ‘hello’, ‘bar’: ‘hi’}, function() { console.log(‘Settings saved’); }); // Read it using the storage … Read more

How to test chrome extensions?

Yes, the existing frameworks are pretty useful.. In the recent past, I have placed all my tests on a “test” page that was embedded in to the application but not reachable unless physically typed. For instance, I would have all the tests in a page accessible under chrome-extension://asdasdasdasdad/unittests.html The tests would have access to localStorage … Read more

AngularJS changes URLs to “unsafe:” in extension page

You need to explicitly add URL protocols to Angular’s whitelist using a regular expression. Only http, https, ftp and mailto are enabled by default. Angular will prefix a non-whitelisted URL with unsafe: when using a protocol such as chrome-extension:. A good place to whitelist the chrome-extension: protocol would be in your module’s config block: var … Read more

Where does Chrome store extensions?

Storage Location for Unpacked Extensions Extension engine does not explicitly change their location or add a reference to its local paths, they are left in the place where there are selected from in all Operating Systems. Ex: If I load a unpacked Extension from E:\Chrome Extension the unpacked Extension is still in the same location … Read more

How to save CSS changes of Styles panel of Chrome Developer Tools?

You can save your CSS changes from Chrome Dev Tools itself. Chrome now allows you to add local folders to your Workspace. After allowing Chrome access to the folder and adding the folder to the local workspace, you can map a web resource to a local resource. Navigate to the Sources panel of the Developer … Read more

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