Using Tampermonkey to save audio volume at OTOTOY across webpages.
Summary
This post:
- using (base) JavaScript + Tampermonkey to save OTOTOY Audio Volume
Motivation
- OTOTOY does not save the volume of previewing music.
- For every new webpage, volume is set to 100%, too loud for me.
What is OTOTOY?
OTOTOY is a DRM-free, lose-less Music Online Store of Japanese Music.
OTOTOY is not a simple store, it is also an online magazine about music.
We’ve already published interviews and reviews about more than 20,000 different artists. We strive to inform you about the vibrant Japanese music scene and its most unique artists. Our readers are able to listen to an extract of every work discussed about in these articles and buy them.
The albums are available to buy in a variety of formats, all DRM-free: from the simple MP3 and AAC, to WAV, FLAC, ALAC in CD-quality or High-Resolution —24bit/44.1kHz and higher—, to DSD (Direct Stream Digital) files.
Solution
A simple JavaScript is written to:
- Inject into the OTOTOY webpage, with url started with
https://ototoy.jp/_/default/p/
- Use previous volume
- If not found, fallback to
DEFAULT_VOL = 0.1
(10%)
- If not found, fallback to
- If the volume is changed, save it
Source Code
GitLab: https://gitlab.com/noop-blog/ototoy-persistent-volume
License: MIT
Requirements
- Chrome / Firefox, reasonable up to date
- Only Firefox is tested
- “Tampermonkey” extension
Installation
- Install Browser Extension Tampermonkey
- For Firefox, install from addons.mozilla.org
- For other browser, see official site
- Copy the following link
https://gitlab.com/noop-blog/ototoy-persistent-volume/-/raw/master/ototoy_persistent_volume.js
- ⚠️ Check the file content for security first
- Open Tampermonkey Dashboard
- Navigate to “Utilities”
- Paste the link to “Install from URL” and click “Install”
- Click “Install” in the new page
Verify
Volume saved across pages
=> Notice the volume is same for all pages.
Script is running
=> Notice the red 1
on the top-right corner of the extension icon.
Contact
Anything wrong?
Email me: adam \a\ 2isk.in
, replace \a\
with @