From 64a7b5477505a906ba6de6621cd7375bd4b272e5 Mon Sep 17 00:00:00 2001 From: Samq64 <81489795+Samq64@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:29:05 -0400 Subject: [PATCH 1/6] remove options from displayNoneWhileDisabled --- .../reference/addon-api/addon.tab/_index.md | 31 ++----------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/content/docs/reference/addon-api/addon.tab/_index.md b/content/docs/reference/addon-api/addon.tab/_index.md index d50395595..e268c7bf0 100644 --- a/content/docs/reference/addon-api/addon.tab/_index.md +++ b/content/docs/reference/addon-api/addon.tab/_index.md @@ -31,12 +31,11 @@ while (true) { ### Using `addon.tab.displayNoneWhileDisabled` (`dynamicDisable`) We use `addon.tab.displayNoneWhileDisabled` to hide an image when the addon gets disabled. We create a button to hide the image when clicked, and the image succesfully gets hidden, even if the addon is enabled. -We also set the `display` CSS property of the image to `flex` when visible, even though that is not the default value for images. ```js /* userscript.js */ const img = document.createElement("img"); img.classList.add("sa-example-img"); - addon.tab.displayNoneWhileDisabled(img, { display: "flex" }); + addon.tab.displayNoneWhileDisabled(img); const btn = document.createElement("btn"); btn.onclick = () => { // We want to hide the image @@ -54,7 +53,7 @@ We also set the `display` CSS property of the image to `flex` when visible, even .sa-example-img-hide { /* We want to hide the image if the button was clicked, even if the addon is enabled */ - display: none !important; + display: none; } ``` @@ -205,34 +204,10 @@ Options `condition`, `reduxCondition` and `reduxEvents` should be used as optimi Yes Element to hide - - options - Object - No - - - - - - - - - - - - - - - - -
PropertyTypeRequiredDefaultDescription
displayStringNo""The display CSS value to use when the addon is enabled.
- - Hides the given element with `display: none` when the addon is disabled, until it is reenabled. -If the intended `display` CSS property value for the provided element when visible is not the default value for the type of provided element (for example, `block` for `div`s and `inline` for `span`s), you should provide that value inside the options parameter. -If you want to manually hide the element in situations where the addon is enabled, you should use a dedicated class name for that, instead of manually setting `el.style.display = "none";`. Use a class name selector in a userstyle to set `display: none !important;` on the element. +If you want to manually hide the element in situations where the addon is enabled, you should use a dedicated class name for that, instead of manually setting `el.style.display = "none";`. Use a class name selector in a userstyle to set `display: none;` on the element. ### `addon.tab.copyImage` From 49d7a41d33c9ce16a8d8526a1b1ca5d29a5e81fc Mon Sep 17 00:00:00 2001 From: Samq64 <81489795+Samq64@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:32:40 -0400 Subject: [PATCH 2/6] Add resizeEvent to waitForElement --- content/docs/reference/addon-api/addon.tab/_index.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/content/docs/reference/addon-api/addon.tab/_index.md b/content/docs/reference/addon-api/addon.tab/_index.md index e268c7bf0..4beaac13f 100644 --- a/content/docs/reference/addon-api/addon.tab/_index.md +++ b/content/docs/reference/addon-api/addon.tab/_index.md @@ -173,6 +173,13 @@ The writing direction for the language of the Scratch website. + + + + + + +
[] An array of Redux events that must be dispatched before resolving the selector.
resizeEventBooleanNofalseWhether the selector should be resolved on a window resize, in addition to reduxEvents.
From 2c129f142c93aa611b03430d1cc5d0788aef05dc Mon Sep 17 00:00:00 2001 From: Samq64 <81489795+Samq64@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:44:37 -0400 Subject: [PATCH 3/6] update addon.tab.copyImage description --- content/docs/reference/addon-api/addon.tab/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/reference/addon-api/addon.tab/_index.md b/content/docs/reference/addon-api/addon.tab/_index.md index 4beaac13f..6b3a457a3 100644 --- a/content/docs/reference/addon-api/addon.tab/_index.md +++ b/content/docs/reference/addon-api/addon.tab/_index.md @@ -249,8 +249,8 @@ If you want to manually hide the element in situations where the addon is enable Copies a PNG image to the clipboard. -Only run this in response of the user explicitly pressing Ctrl+C. -Internally uses `browser.clipboard.setImageData` in Firefox and `navigator.clipboard.write` in Chrome and Edge. +Only run this in response of the user explicitly clicking a button or pressing Ctrl+C. +Internally uses `browser.clipboard.setImageData` in Firefox versions below 127 and `navigator.clipboard.write` everywhere else. ### `addon.tab.scratchClass` From 2bf35ab29b84446916f0c3891965134ad82a6622 Mon Sep 17 00:00:00 2001 From: Samq64 <81489795+Samq64@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:56:45 -0400 Subject: [PATCH 4/6] Remove addon.tab.loadWorker https://github.com/ScratchAddons/ScratchAddons/issues/4243 --- .../reference/addon-api/addon.tab/_index.md | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/content/docs/reference/addon-api/addon.tab/_index.md b/content/docs/reference/addon-api/addon.tab/_index.md index 6b3a457a3..7113e9346 100644 --- a/content/docs/reference/addon-api/addon.tab/_index.md +++ b/content/docs/reference/addon-api/addon.tab/_index.md @@ -957,31 +957,6 @@ Removes a block that was previously added to the Debugger category in the block Runs the specified script file relative to the extension's root (e.g. `chrome-extension://aeepldbjfoihffgcaejikpoeppffnlbd/`) in a `