- From: Treasure Uvietobore <notifications@github.com>
- Date: Wed, 13 Nov 2024 00:20:49 -0800
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 13 November 2024 08:20:53 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> > ``` This worked perfectly for me -- Reply to this email directly or view it on GitHub: https://github.com/WICG/webcomponents/issues/754#issuecomment-2472793404 You are receiving this because you are subscribed to this thread. Message ID: <WICG/webcomponents/issues/754/2472793404@github.com>
Received on Wednesday, 13 November 2024 08:20:53 UTC