Skip to content

Enable / Disable features in settings of Dev Tools - #2146

Merged
WorldLanguages merged 12 commits into
ScratchAddons:masterfrom
griffpatch:wip3
Apr 15, 2021
Merged

Enable / Disable features in settings of Dev Tools#2146
WorldLanguages merged 12 commits into
ScratchAddons:masterfrom
griffpatch:wip3

Conversation

@griffpatch

Copy link
Copy Markdown
Contributor

Resolves

Bugfix - Event should have no default background color
Enhancement - Enable / Disable features in settings

Comment thread addons-l10n/en/editor-devtools.json Outdated
Comment thread addons/editor-devtools/DevTools.js Outdated
return;
}

if (typeof this.addon.settings !== undefined && !this.addon.settings.get("enableBlockInjector")) {

@TheColaber TheColaber Apr 13, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"enableBlockInjector" doesn't seem to be a setting.... along with a couple other of the IDs you used above... athough they were here in this commit: 0b9a0be#diff-8041d88420f8884c0a0060c016c2070a8b46ee0441c40488f49e962b770dbb00R36-R49

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed - These flags don't exist yet - WL said to hang back on these so they will default to enabled for the time-being until key bindings are configurable...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@griffpatch This check you are doing here always returns true because undefined needs to be a string. Try "undefined" !== undefined in the console.
image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it shouldn't ever be undefined? or am I missing something

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is undefined when running the addon through the extension. Remember, the extension and the addon both use the same code.

@cobaltt7 cobaltt7 Apr 13, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, so on the extension, all features are always enabled? i got it now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is undefined when running the addon through the extension. Remember, the extension and the addon both use the same code.

Hmm, I just stripped these one - Are they required after all (only with quotes). I was assuming that perhaps they weren't needed anymore.

@TheColaber TheColaber Apr 14, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I just stripped these one - Are they required after all (only with quotes). I was assuming that perhaps they weren't needed anymore.

I would assume that they would be needed because the devtools extension does not support setting, but unless we really wanted to add them, they could be "in-editor" settings, or maybe settings in the browser popup. In the extension, it should be erroring out saying "Cannot read property 'get' of undefined".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W_L reminded me that there is an alternative, by checking addon.self._isDevtoolsExtension which is true for the devtools extension.

@cobaltt7

This comment has been minimized.

@griffpatch

griffpatch commented Apr 14, 2021 via email

Copy link
Copy Markdown
Contributor Author

…tom Colors addon makes devtools highlighting not work")
@WorldLanguages WorldLanguages linked an issue Apr 15, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants