How to verify an XPath expression in Chrome Developers tool or Firefox’s Firebug?

Chrome This can be achieved by three different approaches (see my blog article here for more details): Search in Elements panel like below Execute $x() and $$() in Console panel, as shown in Lawrence’s answer Third party extensions (not really necessary in most of the cases, could be an overkill) Here is how you search … Read more

What is the “Upgrade-Insecure-Requests” HTTP header?

Short answer: it’s closely related to the Content-Security-Policy: upgrade-insecure-requests response header, indicating that the browser supports it (and in fact prefers it). It took me 30mins of Googling, but I finally found it buried in the W3 spec. The confusion comes because the header in the spec was HTTPS: 1, and this is how Chromium … Read more

How can I get the URL of the current tab from a Google Chrome extension?

Use chrome.tabs.query() like this: chrome.tabs.query({active: true, lastFocusedWindow: true}, tabs => { let url = tabs[0].url; // use `url` here inside the callback because it’s asynchronous! }); This requires that you request access to the chrome.tabs API in your extension manifest: “permissions”: [ … “tabs” ] It’s important to note that the definition of your “current … Read more

Chrome dev tools fails to show response even the content returned has header Content-Type:text/html; charset=UTF-8

I think this only happens when you have ‘Preserve log’ checked and you are trying to view the response data of a previous request after you have navigated away. For example, I viewed the Response to loading this Stack Overflow question. You can see it. The second time, I reloaded this page but didn’t look … Read more

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