Mozilla Firefox add-on for improving the image viewing UX
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
content
defaults/preferences
locale
skin
tools
.gitignore
README.md
build.bat
chrome.manifest
install.rdf

README.md

ImageTweak ImageTweak icon

Mozilla Firefox add-on for improving the image viewing UX

Homepage - Downloads - User guide - Source code (GitHub) - Contact me

ImageTweak is an add-on for Firefox, Iceweasel and SeaMonkey that enhances the vision of images in the browser by allowing zooming, rotating and viewing them against a custom/neutral/dark/black background.

ImageTweak is free software licensed under the terms of the GPLv3.

GPLv3 logo

User guide

An updated user guide is available.

Contribute

You can contribute code to ImageTweak by sending patches or pull requests, a list of planned features is available. Alternatively you can make donations to support the development of ImageTweak on addons.mozilla.org or by sending bitcoins to 1265ciMoFwnX4y4gGxXNGkiD7Qu24oYSqw.

You can also help by reporting bugs (please, try to be as acccurate as possible by including your OS, browser version, extensions installed, plugins and exact steps to reproduce the bug: if I can't reproduce it, most likely I won't be able to fix it!), suggesting new features or by translating ImageTweak in your language.

Detecting ImageTweak from other extensions (chrome code)

Other extensions that wish to play nice with ImageTweak can use the following function to test for the presence of ImageTweak.

/* 
	Check if ImageTweak is installed and enabled.
	The argument doc is optional.
	* isImageTweakEnabled() returns true if ImageTweak is enabled.
	* isImageTweakEnabled(document) returns true if the content document 
	  is being displayed using ImageTweak
    This works only if run from a browser.xul overlay.
*/
function isImageTweakEnabled(doc) {
	try {
		return ImageTweak ? ImageTweak.enabled(doc) : false;
	} catch (e) {
		return false;
	}
}

Detecting ImageTweak from web pages (content code)

Since version 0.21 ImageTweak injects the imageViewer flag in the navigator object. Web pages that want to know if an advanced image viewer is available in the browser can query navigator.imageViewer:

if (navigator.imageViewer) {
	// an advanced image viewer is available in the browser
} else {
	// no advanced image viewer available
}

This behaviour is on by default but can be disabled by unticking the "Notify websites" checkbox in the preference window or by setting the extensions.imagetweak.contentdetectable preference to false.

Please note that the flag does not contain any information about the name or version of the extension that is providing the image viewer.

Websites may check for this flag to decide between using their custom image viewer or letting the native image viewer do its job.