Skip to content

Check fallback operation if web component fails to register - add method to test #16

@rouilj

Description

@rouilj

Add a method to prevent initialization of the web component. This allows testing of the
fallback support if js is turned off, fails to load, gets filtered etc.

Also if the user can't use the REST interface (it's a separate permission than using the web interface), the
web-component should not be enabled since it will break.

So this ticket checks these failing conditions. I think it's as simple as not running:

customElements.define("roundup-classhelper", ClassHelper);

at the end of the js file.

Perhaps a small function or an if check wrapping the define call that looks at the URL
and if a specific fragment (e.g. #classhelper-wc-toggle) is present, skip loading the component?
This should be quick to check with:
document.URL.endsWith('#classhelper-wc-toggle') or similar check. For now, no need to
make it persistent (via cookie or something).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions