Skip to content

Bookmarklet

Richard Frost edited this page Mar 27, 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.

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

  1. Navigate to the Advanced Profanity Filter Option page.
  2. Download the APF Bookmarklet File (Click the button in the Bookmarklet tab).
  3. Host the file publicly, click on a link for instructions on how to use your desired service
  4. Paste the link to the hosted file (from step 3) into the Hosted File URL box in the Bookmarklet's option tab.
  5. Save the APF Bookmarklet to your browser (Found at the bottom of the Bookmarklet's option tab, named APF). This can be done by dragging it to your browser's Bookmark bar or by right-clicking and copying the link destination and saving that to a bookmark.
    • If you have browser bookmark syncing enabled this may copy to your desired device/browser automatically.
    • Alternatively, you can copy the bookmarklet link and add it to your desired device/browser as a bookmark. If you don't know how to do that check the documentation for your browser.

Usage

Android 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 select 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.

Updates

To update your settings or the version of the filter, you will need to repeat Setup steps 1-3. If you update the file from step 2 as just an update/new version you won't need to complete the steps 4-5. 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 APF bookmarklet file. If you modify your settings (example: add a new word to filter) you will also need to update the bookmarklet file.

Hosting Your Bookmarklet File

Your Bookmarklet code can be hosted anywhere where it is publicly accessible, but you will need to supply a download link, not a link to view the file. 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 and either plain text or a file download.

Google Drive

Requires a Google account

If you supply a link like https://drive.google.com/file/d/<id>/view?usp=sharing... it will be automatically converted to a download link.

  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 that link into Setup step 4 (Hosted File URL text box)

If you need to get the download URL manually, follow these steps:

  1. 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...
  2. The public URL to your file will be https://drive.google.com/uc?export=view&id= and then your ID from step 6

Dropbox

Requires a Dropbox account

If you supply a link like https://www.dropbox.com/s/<id>/filename?dl=0 it will be automatically converted to a download link.

  1. Upload the file to Dropbox
  2. Select the file and then choose the Share button
  3. Select Create a link in the bottom right corner
  4. Click Copy link (or copy it manually) and then close the modal and use the link in Setup step 4 (Hosted File URL text box)

If you need to get the download URL manually, follow these steps:

  1. Change www.dropbox.com to dl.dropbox.com and ?dl=0 to ?raw=1

Github Gist

Requires a GitHub account

If you supply a link like https://gist.github.com/<username>/<id> it will be automatically converted to a download link.

  1. Create a new Gist
  2. Drag the file from step 1 in the Setup section into the window, or click Add file
    • 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 URL from the address bar into Setup step 4

If you need to get the download URL manually, follow these steps:

  1. Copy the ID from the URL in step 4
    • The ID is everything after https://gist.github.com/USERNAME/
  2. The public download URL for your file will be https://gist.githubusercontent.com/, and then your USERNAME, followed by a / and then the ID, and finally end with /raw/ and then the filename (if the gist only has 1 file it the filename can be omitted).
    • Example: https://gist.githubusercontent.com/<USERNAME>/<ID>/raw/apfBookmarklet.js

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