Basic Functions (For userscripts)

Useful functions for myself

These are versions of this script where the code was updated. Show all versions.

  • v0.8.12 2024-09-08
    • bug fix: multiple execution
  • v0.8.11 2024-09-07
    • bug fix: oFunc being loaded multiple times when being a dependency
  • v0.8.10 2024-09-07
    • oFunc.dependencies support: all oFuncs specified in oFunc.dependencies by their id will be loaded before oFunc.func itself executed
  • v0.8.9 2024-09-07
    • now loadFuncs has better support for AsyncFunction: get their return value using await
  • v0.8.8 2024-09-06
    • loadFuncs now supports objFunc.readonly to make their return value write-protected, and allows modifing return objects when objFunc.readonly is falsy
  • v0.8.7 2024-09-06
    • loadFuncs now saves return value only if objFunc.id exists and objFunc.func returns an object
  • v0.8.6.3 2024-03-24
    • bug fix for detectDom
  • v0.8.6.2 2024-03-24
    • bug fix for detectDom
  • v0.8.6.1 2024-03-24
    • queueTask now supports specifying different queue's sleep and max argument
  • v0.8.6 2024-03-24
    • added queueTask
  • v0.8.5.2 2024-03-23
    • bug fix
  • v0.8.5.1 2024-03-23
    • loadFuncs now accept detectDom property in both array format (for multiple selectors to detect) and string format (for single selector to detect) in objFunc
  • v0.8.5 2024-03-23
    • detectDom now works in both callback and promise mode, and prefers promise mode.
  • v0.8.4.2 2024-03-22
    • bug fix
  • v0.8.4.1 2024-03-22
    • bug fix
  • v0.8.4 2024-03-22
    • Assert support
    • testChecker, registerChecker, loadFuncs support
  • v0.8.3 2023-12-29
    • Update getUrlArgv
  • v0.8.2 2023-11-19

    detectDom: added support for attributes change

  • v0.8.1 2023-09-15

    bug fix

  • v0.8 2023-09-15

    detectDom now supports matching multiple selectors in one time

  • v0.7.2 2023-07-28

    fixed an error description mistake

  • v0.7.1 2023-07-19
    • detectDom now uses Set instead of Array to prevent duplicate added nodes
  • v0.7 2023-07-17
    • small bug fixes
    • addStyle now recieves parentElement, css, id as its arguments, and:
      • for shortcut: css, css, id, parentElement, css, id
      • removes old elements with same id in document when using this function with id provided
  • v0.6 2023-07-17

    Added detectDom, which provides ability to monitor document changes

  • v0.5 2023-03-31

    $$CrE: Create new element with pre-configs

  • v0.4 2023-02-10

    The third argument of DoLog now is changed from [Boolean]trace to [String]logger

  • v0.3.2 2023-01-30

    addStyle now returns the

  • v0.0.1.20230130165706 2023-01-30

    code improvements

  • v0.3 2023-01-30

    addStyle arguments support: css | parentElement, css | parentElement, css, attributes

  • v0.2 2022-12-06

    escJsStr支持转义\r,\n和\t

  • v0.1 2022-12-05