Say I want to overwrite form.elements
on all forms (current and future).
Motivation
This question on polyfilling RadioNodeList
could be solved by intercepting all form
elements and manually writing an own getter for the elements
property on them.
How do I intercept?
Apart from the below what other ways are there of creating (form) elements that I need to intercept
document.createElement
document.createElementNS
Node.importNode
Node.cloneNode
DOMImplementation.createDocument
(Maybe, depends how effective overwritingDocument.prototype.createElement
/NS
is)
What are the other downsides?
Seperate question, ignoring the performance hits what good reasons are there for not intercepting node creation?