mostlygeek / millionbook-firefox-addon

Firefox for Android add-on to make millionbook.com fonts bigger

Repository from Github https://github.commostlygeek/millionbook-firefox-addonRepository from Github https://github.commostlygeek/millionbook-firefox-addon

About

I built this as a last minute 🎄 Christmas 🎄 present for my mom. She often reads Chinese stories on Firefox on her tablet. Unfortunately, even the maximum text zoom is too small for her and strains her eyes. [1]

"That's bullshit!", I exclaimed! I can FTFY with Greasemonkey! Oops. Turns out Greasemonkey isn't supported on Firefox for Android. #sadness.

After much grumbling and searching it turned out a custom add-on would do the trick!

How I built it

  • Started at Firefox's Add-On SDK docs and installed the cfx command line utility
  • Using the page-mod SDK, I run a custom script, resizer.js on the millionbook.com website
  • resizer.js adds a floating button, that when clicked will change an inline css style to resize the font. It will also remember the last zoom level across pages.
  • Here's how it looks: (I don't read Chinese so if text is NSFW, oops!)screenshot
  • Built into an XPI file for Android: $ cfx xpi --force-mobile
  • Put it into my Dropbox and bit.ly linked it: http://bit.ly/_millionbook so I can open it on the tablet
  • \o/

How to work on it

  • See Developing extension for Firefox for Android
  • Need to have an Android emulator installed
  • Create a Tablet sized virtual machine, enable Android Developer Mode
  • Testing it
    • in android emulator:
      • use Android Studio GUI to create a new tablet emulator
      • use ~/Library/Android/sdk/emulator: ./emulator -list-avds, ./emulator -avd XXXX to start one
      • use adb devices to find id of running emulators
      • web-ext run -t firefox-android --android-device=emulator-XXXX to run in Firefox in emulator. Firefox Beta must be installed. Android Developer mode + USB debugging must be enabled. Remote debugging via USB must be enabled in Firefox.
    • on Desktop: web-ext run - to test locally
  • Building it: web-ext build
  • try opening this URL: https://millionbook.net/gd/y/yiming/qlxjn/001.htm

[1] official fix in the works - bug 1074381

About

Firefox for Android add-on to make millionbook.com fonts bigger


Languages

Language:JavaScript 100.0%