addon.tab.appendToSharedSpace

Description

Allows multiple addons to add their own UI elements to the same area inside Scratch.
The important part of this API is the order number, which prevents the appending new UI elements from being a racy operation and the order of the buttons varying impredictively, specially in the cases where the addons support dynamicEnable.

Method

Parameter Type Required Description
options Object Yes
Property Type Required Description
space String Yes The ID of the space where the element should be appended.
element HTMLElement Yes The element, owned by the addon calling the method, that should be appended.
order Number Yes The order number for the element. Lowest gets appended first in the parent element.
scope HTMLElement Only for some spaces The specific element to append the element in, for spaces that appear multiple times per page.
Return value Boolean
Description Whether the element was appended.

Scratch editor spaces

stageHeader

Right side of the stage header in editor, embed and projectplayer modes.
The standard CSS margin for the buttons added in this space is margin-right: 0.2rem.

Space parent element div[class^="stage-header_stage-size-row"]
Space starting bound None
Space ending bound Small stage button or fullscreen icon
scope option used
Addon ID Element Order number Visibility in small stage mode
debugger Debugger button 0 Hidden
gamepad Gamepad button 1 Hidden

fullscreenStageHeader

Right side of the stage header in fullscreen mode.
The standard CSS margin for the buttons added in this space is margin-right: 0.2rem.

Space parent element div[class^="stage-header_stage-menu-wrapper"]
Space starting bound None
Space ending bound Fullscreen icon
scope option used
Addon ID Element Order number
gamepad Gamepad button 0

afterGreenFlag

Buttons that go between the green flag and the stop button.

Space parent element div[class^="controls_controls-container"]
Space starting bound Green flag button
Space ending bound Stop button
scope option used
Addon ID Element Order number Visibility in small stage mode
pause Pause button 0 Visible

afterStopButton

Elements that go after the project control buttons.
The standard CSS for the buttons added in this space is padding: 0.25rem.

Space parent element div[class^="controls_controls-container"]
Space starting bound Stop button
Space ending bound None
scope option used
Addon ID Element Order number Visibility in small stage mode
mute-project Muted project indicator 0 Visible
mouse-pos Mouse coordinates 1 Hidden
clone-count Clone count 2 Hidden

afterSoundTab

Added editor tabs that go after the sound tab.
The order number should match the used activeTabIndex by the new tab.

Space parent element div[class^="react-tabs_react-tabs__tab-list"]
Space starting bound Sound tab
Space ending bound Search bar added by editor-devtools
scope option used
Addon ID Element Order number
variable-manager Variables tab 3

Scratch website spaces

afterCopyLinkButton

Buttons that go after the “copy link” button in project pages.

Space parent element .flex-row.action-buttons
Space starting bound Copy link button
Space ending bound None
scope option used
Addon ID Element Order number
remix-tree-button Remix tree button 0

forumsBeforePostReport

Links placed before the “report” button in a specific post.
If the “report” button does not exist, a visible placeholder dot will be added to the page automatically to act as a separator between the forumsBeforePostReport and forumsAfterPostReport spaces.
Addition of the | separator is handled by the space.

Space parent element .postfootright > ul
Space starting bound None
Space ending bound Report button
scope option used ✔️ (usually a div.blockpost)
Addon ID Element Order number
my-ocular Reactions 0
my-ocular Reaction menu 1
my-ocular View in Ocular button 2

forumsAfterPostReport

Links placed after the “report” button in a specific post.
If the “report” button does not exist, a visible placeholder dot will be added to the page automatically to act as a separator between the forumsBeforePostReport and forumsAfterPostReport spaces.
Addition of the | separator is handled by the space.

Space parent element .postfootright > ul
Space starting bound Report button
Space ending bound None
scope option used ✔️ (usually a div.blockpost)
Addon ID Element Order number
show-bbcode Show BBCode button 0

beforeRemixButton

Links placed after the “report” button in a specific post.
If the “report” button does not exist, a visible placeholder dot will be added to the page automatically to act as a separator between the forumsBeforePostReport and forumsAfterPostReport spaces.
Addition of the | separator is handled by the space.

Space parent element div.project-buttons
Space starting bound None
Space ending bound Remix button or see inside button
scope option used
Addon ID Element Order number
project-info Sprite and script count 0

Last updated at 12 July 2021 by Hans5958 on commit d07183b. Improve this page.