Many gadgets are loaded in environments they are not ever used. For example:
* the ReferenceTooltips gadget loads on all pages, but can only be used in devices where a mouse is available (and thus it is possible to hover over references).
* Some gadgets require a certain screen size
* Some gadgets rely on a certain editor being available e.g. mobile editor
Originally suggested by @tgr in T127268#8974464 we should provide "skipFunctions" for gadgets that allow gadget code to not load in certain circumstance.
Initially skipFunctions could be defined inside the Gadget extension and Gadget definitions could use them by reference
e.g. This might look something like this where requires=!touch-device adds a skip function relating to touch device support.
```
var isTouchDevice = 'ontouchstart' in document.documentElement;
var desktopResolution = window.innerWidth >= 1000;
```
```
* ReferenceTooltips[ResourceLoader|default|requires=!touch-device,desktop-resolution|skins=vector,vector-2022,monobook,timeless,modern,cologneblue|type=general|dependencies=mediawiki.cookie,jquery.client]|ReferenceTooltips.js|ReferenceTooltips.css
```