Check whether user has a Chrome extension installed

Chrome now has the ability to send messages from the website to the extension. So in the extension background.js (content.js will not work) add something like: chrome.runtime.onMessageExternal.addListener( function(request, sender, sendResponse) { if (request) { if (request.message) { if (request.message == “version”) { sendResponse({version: 1.0}); } } } return true; }); This will then let you … Read more

Reading response headers with Fetch API

There is a restriction to access response headers when you are using Fetch API over CORS. Due to this restriction, you can access only following standard headers: Cache-Control Content-Language Content-Type Expires Last-Modified Pragma When you are writing code for Google Chrome extension, you are using CORS, hence you can’t access all headers. If you control … Read more

Where to find extensions installed folder for Google Chrome on Mac?

The default locations of Chrome’s profile directory are documented in the User Data Directory article on Googlesource.com. (When this article was written in 2013, the User Data Directory article was at chromium.org.) It says there, To determine the user data directory for a running Chrome instance: Navigate to chrome://version Look for the Profile Path field. … Read more

How do I use WebStorm for Chrome Extension Development?

First Time Setup Open the Settings dialog (File > Settings) Click Languages & Frameworks > Javascript > Libraries Click Download Make sure TypeScript community stubs is selected Select chrome from the list (you can find it quickly by just typing chrome) Click Download and Install Click OK to close the Settings dialog. Steps 2-6 illustrated … Read more

Chrome Extension – Get DOM content

The terms “background page”, “popup”, “content script” are still confusing you; I strongly suggest a more in-depth look at the Google Chrome Extensions Documentation. Regarding your question if content scripts or background pages are the way to go: Content scripts: Definitely Content scripts are the only component of an extension that has access to the … Read more

Access variables and functions defined in page context using a content script

Underlying cause: Content scripts are executed in an “isolated world” environment. Solution: Inject the code into the page using DOM – that code will be able to access functions/variables of the page context (“main world”) or expose functions/variables to the page context (in your case it’s the state() method). Note in case communication with the … Read more

How to use jQuery in chrome extension?

You have to add your jquery script to your chrome-extension project and to the background section of your manifest.json like this : “background”: { “scripts”: [“thirdParty/jquery-2.0.3.js”, “background.js”] } If you need jquery in a content_scripts, you have to add it in the manifest too: “content_scripts”: [ { “matches”:[“http://website*”], “js”:[“thirdParty/jquery.1.10.2.min.js”, “script.js”], “css”: [“css/style.css”], “run_at”: “document_end” } … Read more

Chrome developer tools: View Console and Sources views in separate views/vertically tiled?

Vertical split You can undock the developer tools (by clicking on the icon in the bottom-left corner), which moves it to a new window. Then press Esc to open the console. Both the window and the “small console” can be resized to meet your needs. Horizontal split If you prefer to have the console at … Read more

How to change the locale in chrome browser

Open chrome, go to chrome://settings/languages On the left, you should see a list of languages. Use mouse to drag the language you want to the top, that will change the order for the values in Accept-language of requests. If you still don’t see the language you prefer, it may be cookies. Go to cookies and … Read more

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