ClickToPlugin is a lightweight and highly customizable extension that prevents Safari from launching plug-ins automatically, resulting in faster browsing, reduced fan usage, and increased battery life. It replaces every plug-in object by an unobtrusive placeholder that can be clicked to load the embedded content. Further, it can replace many plug-in-based media players by Safari’s native HTML5 media player. ClickToFlash is a restriction of ClickToPlugin that only deals with Flash content.
ClickToPlugin is currently localized in English, French, German, Spanish, Catalan, Italian, Brazilian Portuguese, Polish, Turkish, Japanese, Simplified Chinese, and Traditional Chinese.
This extension owes its existence and awesomeness to many. I would like to thank
Further, thanks should be given to
ClickToPlugin prevents Safari from launching plug-ins and replaces every plug-in object by a placeholder labeled by the name of the blocked plug-in (fig. 1). Clicking this placeholder loads the original plug-in object. Which plug-ins are blocked can be specified in the preferences. In addition, ClickToPlugin features several control lists to specify objects that should never be blocked or that should be hidden from view instantly. Check the Settings section for complete details on customizing ClickToPlugin.
ClickToPlugin does not block <applet>
elements. These elements are used to embed Java applets into web pages and launch a Java plug-in. The reason is that they cannot be blocked.
ClickToPlugin has extensible plug-in-to-HTML5 capabilities. When ClickToPlugin can replace a plug-in objects by an HTML media element, the label of the placeholder is changed accordingly (fig. 2), and a preview image of the media is shown when available. Clicking such a placeholder loads Safari’s native media player (fig. 3).
The original plug-in object can still be loaded by right-clicking the placeholder and choosing “Load Plug-in”, by right-clicking the media player and choosing “Restore Plug-in”, or by using the source selector.
With the default configuration, ClickToPlugin can create HTML5 versions of most plug-in-based players (both on-site and embedded) from the following websites: BBC, Blip.tv, Break, Dailymotion, Facebook, IGN, Metacafe, TED, and YouTube. It can also find audio/video replacements to several generic Flash and Silverlight players, and use existing <audio>
/<video>
fallback content. Finally, it can replace QuickTime, Windows Media, and DivX plug-in objects by HTML media elements.
ClickToPlugin’s media player provides additional functions through the shortcut menu or the source selector. It can
The following devices or applications provide AirPlay servers that are known to be compatible with the extension:
36667
by default);Note that there is no streaming involved when ClickToPlugin requests an AirPlay device to play a video: only the video URL is transmitted.
A list of all available media sources (for example differing in quality) appears when hovering in the top left corner of a media placeholder (fig. 4 left) or the media player (fig. 4 center). On a media placeholder, clicking a source loads that source in the HTML5 media player. In the media player, clicking a source loads that source and jumps to the current playback time if the media is seekable. When right-clicking a source, the “Download Video”, “Open in QuickTime Player”, and “Send via AirPlay” commands apply to that particular source.
When sources are available to play with the HTML5 player but the settings prevent any of them from being used by default, an asterisk appears on the placeholder’s badge to indicate that alternative media sources are available (fig. 4 right).
ClickToPlugin can load whole playlists into the media player. With the default configuration, it will do so for various types of YouTube playlists and some generic Flash players. When a playlist is used, a track selector is accessible through a keyboard shortcut. The track selector is a normal HTML <select>
element and behaves as such.
ClickToPlugin uses a custom interface for its preferences. It can be accessed in three ways: from the Extension tab in Safari’s preferences, using an optional shortcut menu item, or using a customizable keyboard shortcut. The preference window overlays the current page, except if the top document is an HTML4 frameset document, in which case it opens in a new tab instead.
When the preference window is standing on top of a web page, you can dismiss it by clicking outside it (this click does not affect the underlying web page), by using the same keyboard shortcut that opens the preference window, or by pressing ⌘W (Command-W).
<object>
tag designed to be used by the browser in case it lacks a plug-in to handle the object. If checked, plug-in objects with <audio>
or <video>
fallback content will behave as if the required plug-in was not installed.7000
). An Apple TV’s hostname is obtained from the Apple TV’s name (found in Settings > General > Name) by replacing spaces by hyphens and appending .local
. For example, the Apple TV “Living Room Apple TV” has hostname living-room-apple-tv.local
; to use the XBMC server on that Apple TV instead of the built-in server, you would use living-room-apple-tv.local:36667
.In this tab you can specify which plug-ins are not blocked by ClickToPlugin.
A line in a control list matches a URL if either
@
and is a substring of the given URL, or@
and the rest of the line is a valid Javascript regular expression that matches the given URL.The first two control lists are the whitelists and the latter two the blacklists. A pair of lists matches a given plug-in object if either
When an instance of a plug-in that is not selected under the “Plug-ins” tab is about to be loaded in a document, ClickToPlugin blocks it unless either
If a plug-in object is blocked, then ClickToPlugin further removes it from the document if either
The next two settings control ClickToPlugin’s choice of default source to be used when the placeholder is clicked. Other sources can only be loaded from the source selector.
preload
attribute set to none
, to auto
, or with the autoplay
attribute. With the “Do not preload” option selected, the video only starts buffering when the “Play” button is clicked.canplaythrough
event is fired; instead playback will begin as soon as possible.To set a keyboard shortcut, click in the text field and type the desired shortcut. The four modifier keys ⇧ (Shift), ⌃ (Control), ⌥ (Option), and ⌘ (Command) can be used. To set a mouse shortcut, hover the mouse pointer over the square to the right of the text field, and perform the desired mouse action. The left button, middle button, and mouse wheel can be used, possibly with modifier keys.
Clearing a shortcut prevents ClickToPlugin from registering a listener to this shortcut.
Some shortcuts will not work while watching a video in fullscreen mode. If applicable, the “Enter fullscreen” shortcut can be used to exit fullscreen. The ⎋ (Escape) key can also be used to exit fullscreen.
Version 3.2 is the final version of ClickToPlugin.
killers/YouTube.js
now performs two additional tasks:
/watch
pages (which is mostly useless if the Flash player is not used) (thanks Maxime Michel!)javascript:
source (this fixes a bug introduced in 2.7.3)safari
is undefined (thanks Mark Irwin and Brian Mastenbrook!)canplaythrough
even if it was previously paused by the userSP
playlistsUL
(user) and AV
(artist) playlists<object>
tags with a classid
attribute are not blocked anymore since Safari ignores themapplication/xhtml+xml
data:
URI protocol and uses MIME type sniffing as a last resort, following WebKit’s internal mechanismaddEventListener
method, to avoid conflicts with other scripts (thanks Josh Rafofsky!)<applet>
elements anymore