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

[New addon] Stepping in Scratch editor #74

Closed
BoomerScratch opened this issue Aug 18, 2020 · 4 comments · Fixed by #92
Closed

[New addon] Stepping in Scratch editor #74

BoomerScratch opened this issue Aug 18, 2020 · 4 comments · Fixed by #92
Labels
new addon Related to new addons to this extension. `scope: addons` should still be added. scope: addon Related to one or multiple addons type: enhancement New feature for the project

Comments

@BoomerScratch
Copy link
Contributor

Describe the new addon

It allows you to see which blocks currently run in the Scratch editor.

Link to the new addon

https://gist.github.com/BoomerScratch/0592337050810244236d69a4267b3913

@BoomerScratch BoomerScratch added the new addon Related to new addons to this extension. `scope: addons` should still be added. label Aug 18, 2020
@WorldLanguages
Copy link
Member

This "find vm" approach should probably be made by the addon loader so that many addons can access the VM object (and not just this one). Related to #17

@BoomerScratch
Copy link
Contributor Author

@WorldLanguages addon.ScratchVM?

@WorldLanguages
Copy link
Member

@BoomerScratch Yeah, it will probably be addon.tab.getScratchVM (returns a promise) and will resolve when it finds the VM.

@WorldLanguages
Copy link
Member

WorldLanguages commented Aug 21, 2020

Okay I think the API is working now, wanna try to add your addon?

  1. Create an editor-stepping folder inside the addons folder.
  2. Add "editor-stepping" to addons.json
  3. Add an addon.json file to your addon's folder, you can use editor-devtools's manifest as a base (IMPORTANT: make sure to set enabled_by_default to true, so that you don't have to manually enable it inside the background script's console)
  4. Have a userscript.js that goes like this:
export default async function({ addon, global, console }) {
  const vm = await addon.tab.getScratchVM();
  // Do whatever with vm
}
  1. Reload the extension on chrome://extensions and hopefully it works :)
    Tag me if you need help.

@Hans5958 Hans5958 added type: enhancement New feature for the project scope: addon Related to one or multiple addons labels Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new addon Related to new addons to this extension. `scope: addons` should still be added. scope: addon Related to one or multiple addons type: enhancement New feature for the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants