// @description Several options to make JTV a more user friendly experience.
// @include http://*.justin.tv/*
// @namespace #jtvf1x
// @version 0.30.hi3
// ==/UserScript==
// This option changes clips pages to a low light mode (ie. no more blinding white background at 2AM). For now (at least) this gets rid of the Gigya quick embed option below the clips. Does anyone even use that?
== About User Scripts ==
var lowLight=true;
The purpose of [[Greasemonkey]] is to manage user scripts.
[[User script]]s allow the ''user'' to control the way they use the web, by customizing it with scripting.
The [https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/ Greasemonkey extension] won't do any good without any scripts installed.
// Remove ad above chat and expand chat window to the top of the page.
The first thing an eager user should do is find and install ''(or write!)'' a useful script.
var bigChat=true;
:* A word on finding [[user script]]s. They may be located anywhere on the internet but you should look first at [[User_Script_Hosting|common hosts]].
// Remove the Related Live Channels section on channels.
Installation of a script is most often done by clicking a link on a web page.
<!-- Not in 4.0
One may also drag-and-drop a local file into the browser window, or optionally use the menu bar [http://support.mozilla.com/en-US/kb/Menu+Reference#Open_File_ File → Open File...] dialog to open it.
-->
var removeRelated=true;
:* Any file that ends in '''<code>.user.js</code>''' is a user script.
// Remove the Next Channel prompt at the upper right of channels.
When navigating to a URL which ends with <code>.user.js</code>, [[Greasemonkey]] will trigger the installation dialog.
Note that [[Greasemonkey]] must be [[Troubleshooting_(Users)#Greasemonkey Enabled Status|enabled]] to do so.
var noNext=true;
== The Installation Dialog ==
// !!!!!!!!! DO NOT CHANGE ANYTHING BELOW THIS !!!!!!!!!!!
When navigating to a [[user script]], Greasemonkey will open its installation dialog instead of loading the script like a normal page.
A thumbnail of this dialog is shown to the left.
It displays the name and description of the script as well as the [[include and exclude rules]] and special [[API]]s that apply.
<!-- Not in 4.0!
''Note:'' Greasemonkey must be [[Troubleshooting (Users)#Greasemonkey Enabled Status|enabled]] to install scripts.
-->
var clipPage = document.getElementById('next_clip');
;* The Install button
This button will, of course, install the script in question.
Like the Firefox extension installation dialog, this button is disabled for a few seconds to avoid the same potential [http://www.squarefree.com/2004/07/01/race-conditions-in-security-dialogs security vulnerability].
if(clipPage)
;* The Cancel button
{
This button will cancel the installation of a script.
var getDownloaded = document.getElementById('downloaded');
This button will allow viewing of the source code contained in the script.
At this point, [[Greasemonkey]] has already downloaded the [[user script]] in question to display the name and other details.
// Lower the lights on clips pages.
When a user shows the script source, it displays the temporary file that Greasemonkey has already downloaded depicted in this [[:media:View-source.png|screenshot]].
In this window there is an information bar at the top similar to the Firefox extension installation security warning.
Clicking the install button here will also install the script.
if(lowLight && clipPage)
-->
{
Now with some scripts installed, we can open the [[Greasemonkey Manual:Monkey Menu|Monkey Menu]] to list and manage them.
The purpose of Greasemonkey is to manage user scripts.
User scripts allow the user to control the way they use the web, by customizing it with scripting.
The Greasemonkey extension won't do any good without any scripts installed.
The first thing an eager user should do is find and install (or write!) a useful script.
A word on finding user scripts. They may be located anywhere on the internet but you should look first at common hosts.
Installation of a script is most often done by clicking a link on a web page.
Any file that ends in .user.js is a user script.
When navigating to a URL which ends with .user.js, Greasemonkey will trigger the installation dialog.
Note that Greasemonkey must be enabled to do so.
The Installation Dialog
When navigating to a user script, Greasemonkey will open its installation dialog instead of loading the script like a normal page.
A thumbnail of this dialog is shown to the left.
It displays the name and description of the script as well as the include and exclude rules and special APIs that apply.
The Install button
This button will, of course, install the script in question.
Like the Firefox extension installation dialog, this button is disabled for a few seconds to avoid the same potential security vulnerability.
The Cancel button
This button will cancel the installation of a script.
Now with some scripts installed, we can open the Monkey Menu to list and manage them.