A simple JavaScript script that adds a floating "Archive" button to specific news websites, allowing quick archiving via archive.md.


A simple JavaScript script that adds a floating "Archive" button to specific news websites, allowing quick archiving via archive.md.
As a non-Japanese speaker (reader), it's hard for me to know how to use SBI website sbisec.co.jp. Although there is Google Translate, it's not good in handling text in images (Safari can but it's not really good or fast).
Luckily, SBI website uses static images for buttons, therefore, we can replace the image button with text button.
Demonstrate:
To use this, you can use any extensions that can inject script and stylesheet into the page or create your own extension.
import {LifecycleObserver, LifecycleOwner} from "./lifecycleowner"; | |
interface Observer<T> { | |
onChange(value: T): void; | |
} | |
class SimpleObserver<T> implements Observer<T> { | |
constructor(private callback: (value: T) => void) { | |
} |
░██████╗░██╗████████╗██╗░░██╗██╗░░░██╗██████╗░ ░█████╗░░█████╗░████████╗██╗░█████╗░███╗░░██╗░██████╗ | |
██╔════╝░██║╚══██╔══╝██║░░██║██║░░░██║██╔══██╗ ██╔══██╗██╔══██╗╚══██╔══╝██║██╔══██╗████╗░██║██╔════╝ | |
██║░░██╗░██║░░░██║░░░███████║██║░░░██║██████╦╝ ███████║██║░░╚═╝░░░██║░░░██║██║░░██║██╔██╗██║╚█████╗░ | |
██║░░╚██╗██║░░░██║░░░██╔══██║██║░░░██║██╔══██╗ ██╔══██║██║░░██╗░░░██║░░░██║██║░░██║██║╚████║░╚═══██╗ | |
╚██████╔╝██║░░░██║░░░██║░░██║╚██████╔╝██████╦╝ ██║░░██║╚█████╔╝░░░██║░░░██║╚█████╔╝██║░╚███║██████╔╝ | |
░╚═════╝░╚═╝░░░╚═╝░░░╚═╝░░╚═╝░╚═════╝░╚═════╝░ ╚═╝░░╚═╝░╚════╝░░░░╚═╝░░░╚═╝░╚════╝░╚═╝░░╚══╝╚═════╝░ | |
╭────────────────────────╮ | |
┌─────┐ ┌─────┐ │╭──────────────────────╮│ | |
│ A │ │ B │ ││ https://example.com ││ | |
└──┬──┘ └──┬──┘ │╰──────────────────────╯│ | |
│ │ │┌──────────────────────┐│ | |
│foo │ ││ Welcome! ││ | |
├─────────────────▶ ││ ││ | |
│hello │ ││ ╭────────────────╮ ││ | |
├─────────────────▶───┐ ││ │ username │ ││ | |
│ world │ │prompts ││ ╰────────────────╯ ││ |
{"type":"G","i":"01-AAJypSwDcDi=72dzyy5Gv0jhnAd","v":24735131,"ss":[{"type":"T","i":"01-AAWBiFQgS39glWHKZ8MZrC37vVr","v":-1076953303,"b":"27|19|28|3","t":"Loading","e":{"be":{"fe":false,"fu":"F1","be":true,"bu":"S1","du":"1|0|0"},"tha":1,"tva":1}},{"type":"T","i":"01-AAC+tFQlj8Qn35RCwuY6KCt+wJ1","v":995948949,"b":"27|23|28|3","t":"Error(errorType)","e":{"be":{"fe":false,"fu":"F1","be":true,"bu":"S1","du":"1|0|0"},"tha":1,"tva":1}},{"type":"T","i":"01-AA41zFQV5PmkL1thuzox28DZdCq","v":1171550411,"b":"27|27|28|3","t":"Content(content)","e":{"be":{"fe":false,"fu":"F1","be":true,"bu":"S1","du":"1|0|0"},"tha":1,"tva":1}},{"type":"T","i":"01-AA=v=FQBDSwnNDCVYvWBRu8SvCI","v":1332844473,"b":"72|17|28|3","t":"RenderingAdvertisement","e":{"be":{"fe":false,"fu":"F1","be":true,"bu":"S1","du":"1|0|0"},"tha":1,"tva":1}},{"type":"T","i":"01-AA91CGQkBz0RwMpCWUizmF3v5uM","v":-1306080998,"b":"72|21|28|3","t":"RenderingContent","e":{"be":{"fe":false,"fu":"F1","be":true,"bu":"S1","du":"1|0|0"},"tha":1,"tva":1}},{"type":"T","i":"0 |
A simple script for adding a jump key (N
/ B
) with two guidelines to help reading on PC easier.
The progress is also more trackable with page and percent
import re | |
text_formats = ['b', 'i', 'u', 'f'] | |
dark_colors = ["black", "red", "green", "yellow", "blue", | |
"magenta", "cyan", "gray"] | |
light_colors = ["brightblack", "brightred", "brightgreen", "brightyellow", "brightblue", | |
"brightmagenta", "brightcyan", "white"] | |
def code(number): |
{"type":"G","i":"lineandroid-studysession","v":1946641214,"ss":[{"type":"T","i":"01-AAJMj5q9y5mOEplaxEp31p58LhV","v":1272397638,"b":"3|328|71|4","t":"","e":{"be":{"fe":true,"fu":"F3","be":false,"bu":"S1","du":"1|0|0"},"tha":1,"tva":1},"te":false},{"type":"T","i":"01-AAqVafqKeFtLGk+a3q6VqqYcyTl","v":-2021500222,"b":"12|224|12|9","t":"","e":{"be":{"fe":true,"fu":"F4","be":false,"bu":"S1","du":"1|0|0"},"tha":1,"tva":1}},{"type":"T","i":"01-AAUbUfqvPsIPnvpCC2MqZUlAVbo","v":1348027652,"b":"5|224|7|5","t":"","e":{"be":{"fe":true,"fu":"F4","be":false,"bu":"S1","du":"1|0|0"},"tha":1,"tva":1}},{"type":"T","i":"01-AALQp5q31iA3cKeveDqpD7ztPpZ","v":1026161957,"b":"56|331|18|16","t":"GitHub","e":{"be":{"fe":true,"fu":"F4","be":false,"bu":"S1","du":"1|0|0"},"tha":1,"tva":2}},{"type":"T","i":"01-AATm04oC=YtfjV8MM4J3+wq9Mfl","v":-449682756,"b":"3|41|41|5","t":"\n╦ ╦┬ ┬┬ ┬ ╦ ┌┬┐┌─┐┌┬┐┌─┐ ┌┬┐┬ ┬┬┌─┐┌─┐\n║║║├─┤└┬┘ ║ │││├─┤ ││├┤ │ ├─┤│└─┐ ┌┘\n╚╩╝┴ ┴ ┴ ╩ ┴ ┴┴ ┴─┴┘└─┘ ┴ ┴ ┴┴└─┘ o \n","e":{"be":{"fe":false,"fu":"F1","b |
This script attaches a stopwatch into the toolbar of Leetcode's problem page.
The feature is simple:
Use this script with any browser extension allowing attaching JS to the page. (I use User JavaScript and CSS)