browser
getting HTML source or rich text from the X clipboard
To complement @rkhayrov’s answer, there exists a command for that already: xclip. Or more exactly, there’s a patch to xclip which was added to xclip later on in 2010, but hasn’t been released yet that does that. So, assuming your OS like Debian ships with the subversion head of xclip (2019 edit: version 0.13 with … Read more
How to detect prefers-color-scheme change in javascript?
You can add an event-listener with callback on the MediaQueryList returned by Window.matchMedia(): function activateDarkMode() { // set style to dark } // MediaQueryList const darkModePreference = window.matchMedia(“(prefers-color-scheme: dark)”); // recommended method for newer browsers: specify event-type as first argument darkModePreference.addEventListener(“change”, e => e.matches && activateDarkMode()); // deprecated method for backward compatibility darkModePreference.addListener(e => e.matches … Read more
ERR_SSL_PROTOCOL_ERROR not able to see https localhost pages in chrome browser
Go to chrome://net-internals in the Chrome and switch to the Domain Security Policy tab. In the “Delete domain security policies” section at the bottom, write “localhost” in Domain field and press the “Delete” button. Note, this is a temporary fix.
How to have AJAX trigger the browser’s loading indicator
I think this is your answer. (Reverse-AJAX or “Slow Load” technique from Obviously.com) Looks like the GMail and Facebook method (browser is showing page as “loading” with loading icons etc. – it is just simulating, because there is a background ajax request) 🙂
Where to store a JWT token properly and safely in a web based application?
Where to Store Your JWTs With token-based authentication, you are given the choice of where to store the JWT. We strongly recommend that you store your tokens in local storage/session storage or a cookie. Web Storage (local storage/session storage) Commonly, the JWT is placed in the browsers local storage and this works well for most … Read more
How do you edit Javascript in the browser?
In Chrome: Open Chrome DevTools -> Sources panel, browse in left navigation, or press Ctrl+O to open files included in the page. Then you can edit the file and press Ctrl+S to save the change, and see what happens with the new codes. I usually do it with the help of break points. If you … Read more
Are there Firefox keyboard shortcuts to clear the cache?
I think Ctrl+Shift+Delete takes out all private data, including the cache. Heres a link that’ll tell you how to set up specific options.
How can I determine a user’s locale within the browser?
The proper way is to look at the HTTP Accept-Language header sent to the server. This contains the ordered, weighted list of languages the user has configured their browser to prefer. Unfortunately this header is not available for reading inside JavaScript; all you get is navigator.language, which tells you what localised version of the web … Read more