Skip to content

Bookmarklet

Richard Frost edited this page Mar 11, 2019 · 13 revisions

Advanced Profanity Filter (APF) Bookmarklet

When you can't install the extension but would still like to filter a webpage, your best option is to use the Advanced Profanity Filter (APF) Bookmarklet. To create a personal bookmarklet with your configuration, navigate to the extension's Options page and open the Bookmarklet tab.

Differences Between Extension

Pros:

  • Runs on most browsers, including mobile Google Chrome and iOS Safari
  • Only runs when you want it (must manually activate the bookmarklet)
  • Compatible with the same configuration as the extension

Cons:

  • Not run automatically; you have to run the bookmarklet on each page and every reload
  • No UI to modify settings
  • No auto-updating

Setup

A few steps are required to get the APF Bookmarklet filter ready for use. You will need to:

  1. Generate the APF Bookmarklet filter code file (done in the Bookmarklet Option's tab).
  2. Host the file publicly somewhere.
    • A couple free options are Google Drive or a GitHub Gist. See below for a quick runthrough of how to publicly host a file and find its URL.
  3. Generate the APF Bookmarklet by supplying the hosted file URL from step 2 and save the APF Bookmarklet to your browser. If you have browser bookmark syncing enabled this can be done in your browser by simply dragging it to your Bookmark bar.
    • Alternatively, you can share the bookmarklet link and add it to your desired device/browser.
  4. To update your settings or the version of the filter, you will need to repeat steps 1 and 2. If you just update the file you won't need to complete step 3 again, because the URL should be the same. The APF Bookmarklet uses the same codebase as the extension, so when a new version of the extension is released it is recommended that you update your bookmarklet filter code as well. If you modify your settings (example: add a new word to filter) you will also need to update the bookmarklet file.

Usage

Google Chrome Mobile

To activate the APF Bookmarklet filter you will need to browse to the desired page and then from the Omnibox (address bar) start typing your bookmark's name (example: APF) and then click on it. Using the bookmark manager on Chrome Mobile doesn't allow bookmarklets to run.

iOS Safari (iPod/iPhone/iPad)

To activate the APF Bookmarklet filter, browse to the desired page, open your Bookmarks and then tap on the bookmarklet.

Examples For Hosting Your Bookmarklet

Your Bookmarklet code can be hosted anywhere where it is publicly accessible. Below are a couple examples, but there are countless other services that you could use. Regardless of which service you use, you can test the URL by opening it in an Incognito/Private browser window and make sure its accessible.

Github Gist Example

Requires a GitHub Account

  1. Create a new Gist
  2. Drag the file from step 1 in the Setup section above into the window
    • Alternatively copy the contents of that file into the Gist and provide a filename, such as apfBookmarklet.js
  3. Click the Create secret gist button (or choose public you would like)
  4. After being redirected to the gist, copy the id from the address bar
    • The ID is everything after https://gist.github.com/USERNAME/
  5. The public URL for your file will be https://gist.githubusercontent.com/, and then your USERNAME, followed by a / and then your ID from step 4, and finally end with /raw/apfBookmarklet.js
    • Example: https://gist.githubusercontent.com/<USERNAME>/<ID>/raw/apfBookmarklet.js

Google Drive

Requires a Google Account

  1. Upload the file to Google Drive
  2. Right click on the file and then select Share...
  3. Click Advanced in the bottom right corner
  4. Under the Who has access options click on Change
  5. Select On – Public on the web and then Save
  6. Copy the file ID you can find in the text field at the top of the window
    • The ID is found between https://drive.google.com/file/d/ and /view?usp=sharing...
  7. The public URL to your file will be https://drive.google.com/uc?export=view&id= and then your ID from step 6

More Info

Other Notes

All extension API calls have been removed or are short-circuited. This has the following effects:

  • No word count (showCounter) or summary (showSummary) for filtered words
  • If muteAudio is true, muteMethod is forced to 1 (mute video volume)
Clone this wiki locally