-
Notifications
You must be signed in to change notification settings - Fork 28
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
A few steps are required to get the APF Bookmarklet filter ready for use. You will need to:
- Generate the APF Bookmarklet filter code file (done in the Bookmarklet Option's tab).
- 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.
- 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.
- 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.
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.
To activate the APF Bookmarklet filter, browse to the desired page, open your Bookmarks and then tap on the 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.
Requires a GitHub Account
- Create a new Gist
- 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
- Alternatively copy the contents of that file into the Gist and provide a filename, such as
- Click the Create secret gist button (or choose public you would like)
- After being redirected to the gist, copy the id from the address bar
- The ID is everything after
https://gist.github.com/USERNAME/
- The ID is everything after
- 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
- Example:
Requires a Google Account
- Upload the file to Google Drive
- Right click on the file and then select Share...
- Click Advanced in the bottom right corner
- Under the Who has access options click on Change
- Select On – Public on the web and then Save
- 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...
- The ID is found between
- The public URL to your file will be
https://drive.google.com/uc?export=view&id=
and then your ID from step 6
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
istrue
,muteMethod
is forced to1
(mute video volume)