Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add addon compatibility checklist #225

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions content/docs/reference/addon-compatibility-checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Addon Compatibility Checklist
aliases:
- /docs/developing/addon-compatibility-checklist
---

When developing an addon, make sure to review the categories that you're editing for any factors that need to be considered.

# Non-Editor Addons

## Navbar
New addons that modify the navbar must be compatible with the following addons:
- Customizable navigation bar
- Expandable search bar

# Editor Addons

## General

Any elements inside `<div id="app">` that are modified with a userscript will be wiped and restored to vanilla Scratch when the user switches to the project page. This also happens with other parent `div`s: for example, when a new button is added to the color picker, then the color picker is closed. The convention is to reinstate custom UI elements by using a `while (true)` loop with `addon.tab.waitForElement` like so:

```js
while (true) {
let element = await addon.tab.waitForElement(/* CSS selector of desired parent element from regular Scratch */, {
markAsSeen: true,
}
/* Re-initialize anything related to the UI here */
}
```

## Stage Header
New addons that add elements to the stage header must be compatible with the following addons by using their respective spaces with the [`addon.tab.appendToSharedSpace`](https://scratchaddons.com/docs/reference/addon-api/addon.tab/addon.tab.appendtosharedspace/) API:
- 60FPS project player mode
- Clone counter
- Gamepad support
- Mouse position
- Muted project player mode
- Pause button

Other things that affect the stage header:
- Entering and exiting full screen (the `fullscreenStageHeader` space must be used in full screen)
- Activating Turbo Mode
- The "reverse order of project controls" addon