List all chrome extensions pragmatically
December 15, 2021
chrome
extension
My QA colleague asked me the other day about how to list all chrome extensions pragmatically.
Found two solutions:
Unprettify ligatures with idle timer in emacs
December 4, 2021
emacs
Emacs prog-mode provide prettify symbol for ligatures. It also has a prettify-symbols-unprettify-at-point
option to unprettify symbols when cursor is on the symbol. Below is code snippet to only unprettify when emacs is idle for 1 second.
(after! prog-mode
;; unprettify when idle for 1 seconds
(defadvice! +prettify-symbols--post-command-hook (orig-fn)
:around #'prettify-symbols--post-command-hook
(run-with-timer 1 nil
(cmd! (let ((ti (current-idle-time)))
(when (or (> (nth 1 ti) 0)
(> (nth 2 ti) 900000))
(funcall orig-fn)))))))
Inject script into pages as early as possible with web extension content script
November 21, 2021
web extension
frontend
TLDR
- set
run_at
to document_start
in manifest.json
- inject code before
<head>
- set the injected script tag to
async=false
- inject with
scriptTag.textContent='inpage code'
instead of using the src=
macOS keychain
November 13, 2021
- there’re passwords with type
internet-password
, application password
, web form password
stored in macOS keychain
- only items with
kSecAttrSynchronizable
are synced
- wifi password and password from safari (
web form password
) are created with kSecAttrSynchronizable
by default
- you can’t query
web form password
with macOS security
command line tool
- you can’t create items with
kSecAttrSynchronizable
with macOS security
command line tool
- keybase/go-keychain has methods to create item with
kSecAttrSynchronizable
Related links:
My road to dark mode
September 13, 2021
dark mode
There’s a reddit drunk post I read months ago talking about a lot about programming life and many things. There’s one thing I want to talk about.
Dark mode is great until you’re forced to use light mode (webpage or an unsupported app). That’s why I use light mode.