mirror of https://github.com/atom/atom.git
Add document.registerElement polyfill
Atom is upgrading to use electron 11.4.7 however on that version chromium has deprecated `document.registerElement`. There are some community packages whose implementations depend on `document.registerElement`. Therefore shipping without a polyfill will break those packages. As Atom maintainers we wouldn't want to introduce a change that has the potential of breaking many packages.
This commit is contained in:
parent
be5aa06bc9
commit
04d6338c70
|
@ -151,6 +151,19 @@
|
|||
)
|
||||
: require('document-register-element');
|
||||
|
||||
const Grim = useSnapshot
|
||||
? snapshotResult.customRequire('../node_modules/grim/lib/grim.js')
|
||||
: require('grim');
|
||||
const documentRegisterElement = document.registerElement;
|
||||
|
||||
document.registerElement = (type, options) => {
|
||||
Grim.deprecate(
|
||||
'Use `customElements.define` instead of `document.registerElement` see https://javascript.info/custom-elements'
|
||||
);
|
||||
|
||||
return documentRegisterElement(type, options);
|
||||
};
|
||||
|
||||
const { userSettings, appVersion } = getWindowLoadSettings();
|
||||
const uploadToServer =
|
||||
userSettings &&
|
||||
|
|
Loading…
Reference in New Issue