- From: Giwayume <notifications@github.com>
- Date: Tue, 27 Dec 2022 18:37:21 -0800
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 28 December 2022 02:37:33 UTC
> the current state of play is that i can do nothing about this.
I wouldn't say there's nothing you can do. Not that it is exactly desirable to do this, but:
```
<script>
// Block certain custom elements from being defined.
const defineCustomElement = CustomElementRegistry.prototype.define;
CustomElementRegistry.prototype.define = function define(name, constructor, options) {
if (name == 'element-you-do-not-want-defined') {
return;
}
return defineCustomElement.call(this, name, constructor, options);
};
</script>
<script src="library-you-want-limit-custom-definitions-from.js"></script>
<script>
// Unblock
CustomElementRegistry.prototype.define = defineCustomElement;
</script>
<script src="this-library-should-work-as-normal.js"></script>
```
--
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/754#issuecomment-1366324022
You are receiving this because you are subscribed to this thread.
Message ID: <WICG/webcomponents/issues/754/1366324022@github.com>
Received on Wednesday, 28 December 2022 02:37:33 UTC