# ServiceNow Userscripts
August 9th, 2016 Laurent Indermühle
This is a collection of userscripts for ServiceNow. Their purpose is to extend
ServiceNow's functionnalities or enhance the agent's quality of life
The userscripts are javascripts that are executed in the browser, usually when
a specific page is displayed. Their names end in "user.js"
You have to install Greasemonkey, Tampermonkey, Scriptish or other similar
addon to run those scripts.
## Script: servicenow-toc.user.js
Runs when a knowledge article is edited. Add a button in the Wysiwyg editor
(TinyMCE) "Create or update table of contents". When pressed, creates unique
ids on titles contained in the text editor and then insert a table of content
with anchor links.
The table of contents is either inserted inplace when it already exists or
just above the first title except for the
one.
Example :
```
Titre Level 1
Description lorem ipsum dolor sit amet, consectetur adipisicing elit, sed
do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Table of content <----
Titre level 2 <----
Titre level 2 <----
Titre level 3 <----
<---- Table of contents inserted above here
Titre Level 2
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
```
## Script: servicenow-inc-autostart-timer.user.js
EDIT Feb. 2018: The timer is no longer mandatory and is started by default. You can remove this script from your tampermonkey.
~~Clicks for you on the start button of the "time_worked" timer of incidents each
time you load one. You'll never have to start the timer yourself again!~~
## Script: servicenow-reload-page.user.js
Reload the page https://support.epfl.ch/epfl?id=epfl_services_status every 5 min.
Useful for our monitoring screen.
## Script: servicenow-darknow.user.js
ServiceNow is much too white, it hurts your eyes.
So this script allows you to change the CSS to make the Service Now pages darker.