Skip to content

Internal Documentation Index

Mike Medley edited this page May 15, 2023 · 3 revisions

GM_config Internal Documentation

The pages listed here are purely for documenting the guts of GM_config. This documentation is not intended for those who wish to use GM_config as a library, but rather those who want join the in the development of GM_config and help improve it.


  • GM_configStruct

    The constructor for the main object users user to interact with GM_config.
    • Prototype methods

      • init

        Allow support for old api usage. It just calls GM_configInit now.
      • open

        Does all the DOM building and paints the GUI to the frame.
      • save

        Reads in all the values from the GUI and saves them to persistent storage.
      • close

        Removes the GUI from the page.
      • set

        API method for directly setting one of the values stored internally.
      • get

        API method for directly accessing one of the values stored internally.
      • write

        Writes all field values to persistent storage.
      • read

        Reads all field values from persistent storage.
      • reset

        Makes all fields in the GUI return to their previously saved values.
      • create

        A helper function that allows for easy creation of DOM Elements.
      • center

        Keeps the GUI centered in the window when the window is re-sized.
      • remove

        A helper function to remove an element from the DOM.
    • Prototype properties

      • onOpen

        A callback method that is called on the GUI has been painted to the frame.
      • onSave

        A callback method that is called once field values have been written to persistent storage.
      • onClose

        A callback method that is called once the GUI has been removed from the page.
      • onReset

        A callback method that is called once the fields in the GUI have been restored to their previously saved values.
      • id

        A unique id for this instance of GM_configStruct.
      • fields

        Where we store the collection of GM_configStruct objects.
      • title

        The title text used for the GUI.
      • css

        The object we use to store both the basic and custom css for the GUI.
  • GM_configInit

    The function we use to initialize a newly created GM_configField object.