Copy text to clipboard from bookmarklet

Since the new Clipboard API, this is easy in browsers that support it: javascript: navigator.clipboard.writeText(‘some text from somewhere’);null; Caveat: Any alerts or prompts in your bookmarklet will cause the document to lose focus, and the clipboard API will become unavailable. In that case you need to move focus back into the document before any subsequent … Read more

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “text/html”

This error usually happens because you deployment was into a subfolder, so it seems like Angular is fetching you app directly from your base URL, so your html is found when you go to your domain.com/mysubfolder/index.html, but as the Angular fetches your resources from domain.com/index.html instead of domain.com/mysubfolder/index.html; I’m pretty sure this is the cause … Read more

Inexplicit ‘task’ in Chrome Performance DevTools

I ran into a similar issue where I had long, opaque “task” taking several seconds without further information in the Dev Tools. A Chrome dev pointed me towards Perfetto (edit: or you can access a built-in similar tool at chrome://tracing). Perfetto lets you record traces of the internals of Chrome. In my case I suspect … Read more

How do I change the default browser used by Jupyter Notebook in Windows?

Thanks to @Darthbith and this post How to change the default browser used by the ipython/jupyter notebook in Linux? I was able to figure it out: Step 1: To open Anaconda Prompt from the Start Menu and type # for old notebook and JupyterLab < 3.0, or jupyter notebook –generate-config # for new nbclassic and … Read more

Access variables and functions defined in page context from an extension

Underlying cause: A content script is executed in an ISOLATED “world” environment, meaning it can’t access JS functions and variables in the MAIN “world” (the page context), and can’t expose its own JS stuff, like the state() method in your case. Solution: Inject the code into the JS context of the page (MAIN “world”) using … Read more

Program Download – IE CHROME – “is not commonly downloaded and could be dangerous.”

The best resources are this blog post and this blog post. To sum up: Sign you package with an authenticode signature. Don’t be malware (I’m sure you got that covered). Logo your software (if it’s not a browser plug-in). This can be a frustrating process, so hang in there. Microsoft has not disclosed how many … Read more

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