Various utilities for userscripts - register listeners for when CSS selectors exist, intercept events, manage persistent & synchronous JSON databases, modify the DOM more easily, useful math and array functions and more
這裡只顯示彼此間有代碼差異的版本。 顯示所有版本。
exports.types
types
exports
module
hexToRgb()
rgbToHex()
#RGBA
#RRGGBBAA
alpha
blue
undefined
upperCase
lightenColor()
darkenColor()
tr.forLang()
tr.getTranslations()
setInnerHtmlUnsafe()
addGlobalStyle()
openInNewTab()
GM.openInTab
background
SelectorObserver
debounce()
DataStore
ConfigManager
defaultConfig
defaultData
deleteConfig()
deleteData()
_uucfg
getSiblingsFrame()
Error.stackTraceLimit
ConfigManager.loadData()
compress()
decompress()
encodeData()
decodeData()
disableOnNoListeners
enableOnAddListener
addGlobalStyle
fetchAdvanced
- Added function `observeElementProp` to watch for a property of an element to change that isn't observable with MutationObserver
amplifyMedia
compress
decompress
NonEmptyString
LooseUnion
- `onSelector()` has been turned into the `SelectorObserver` class to reduce the performance impact on larger sites ([see migration info here](https://github.com/Sv443-Network/UserUtils/blob/main/CHANGELOG.md#300))- Removed the limiter from `amplifyMedia()` for clear and undistorted audio and renamed properties ([see migration info here](https://github.com/Sv443-Network/UserUtils/blob/main/CHANGELOG.md#300))- Added function `randomId()` to randomly generate cryptographically strong hexadecimal IDs- Added utility type `NonEmptyArray` for typing an array with at least 1 item
Changed default limiter options to be more balanced
Added compression to amplifyMedia() to prevent audio clipping and distortion and modified return type accordingly:
amplifyMedia()
amplify()
setGain()
getAmpLevel()
getGain()
enable()
disable()
setLimiterOptions()
limiterNode
insertValues()
tr()
Added UserLibrary header
Exported ConfigMigrationsDict for easier use with TypeScript
Fixed TypeScript error in ConfigManager migrations
Added isScrollable() to check whether an element has a horizontal or vertical scroll bar
isScrollable()
code is no longer minified and now has a userscript header