Skip to content

benjaminlukeclark/Doggify-Firefox

Repository files navigation

Doggify

Github latest release

Firefox stable release

This is an extension for firefox that will let you:

  • Automatically replace all images on a webpage with doggos
  • Change your preference for what breed of doggo is displayed via an addon settings menu
  • Right click an image and doggify it

You can turn off the automatic replacement of images in the extension's settings menu.

Check it out here on Firefox!

Click here for the Github page!

Acknowledgements

Icon by Freepik from Flaticon

Uses the dog-ceo-api by ElliottLandsborough with the source code in this repo

Overview

Continous Doggos

When enabled the plugin will automatically replace all images on a webpage with dogs.

It will then check for pictures not populated by the extension every second, and replace these with dog pictures. This should mean that images dynamically injected into the page are replaced with dogs relatively quickly.

Say for example someone is searching for some nasty cades on google images. Normally, they would see something similar to this:

NastyCades

But once this extension is installed all we see are lovely doggos!

LovelyDoggos

Doggify an image

This extension extends the Firefox context menu to include a "Doggify me!" option whenever clicking on an image:

Doggify-me-pre

If you select this option then the image in question will be changed to a doggo.

Doggify-me-post

Settings

This can be accessed in firefox by going to "options > addons > extensions > doggify > options".

Doggify-me-post

Remember to "save" when you make changes to the settings menu!

Future Plans

  • Dynamically resize dog image

Setup Checklist

Simply add the extension in Firefox: https://addons.mozilla.org/en-GB/firefox/addon/doggify/

Development/Debugging

  • Download repo
  • Open the about:debugging page in Firefox
  • Navigate to the repo and select the manifest.json file
  • Select "Inspect" to see the web console for the settings page

Note: Adding an extension via the method above only adds it for that session of Firefox; if you close then start Firefox again the Doggify extension will not be loaded.

Any changes you make to existing files should update automatically on a page refresh, although sometimes you'll need to close and open Firefox again.

Extension Anatomy

beautiful-doggos is the content script injected into webpages that:

  • First replaces all images with dogs if continous doggos is enabled
  • Sets up a timer to replace all non-dog images every second is continous doggos is enabled
  • Listens for requests from the background script

background is the background script, it will:

  • Create the "Doggify me!" context menu
  • Sends messages to the content script on context menu click

The icons folder contains icons for the entire extension to consumed by the manifest and context menu items

The settings folder contains HTML/CSS/JS relating to the settings page displayed to the user via addons > extensions > Doggify > options. It uses browser.storage.sync.set to set preferences, whilst the background script uses browser.storage.sync.get to get these preferences.

Compatibility

  • The iteration of images HTMLCollection is done via the following syntax:
for (let image of imagecollection ) {
    // stuff
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.