1. не понимаю, в чем проблема
element.querySelectorAll('> *')
upd: ok, такой вариант не работает)
тогда
http://stackoverflow.com/a/21126966/5215084
или как-то так
function getChildrenByTagName(root, tagName = '*') {
let originRootId = root.id;
let tempRootId = '___' + Date.now();
root.id = tempRootId;
let children = document.querySelectorAll(`#${tempRootId} > ${tagName}`);
root.id = originRootId;
return children;
}
2. я бы не стал "патчить" прототипы встроенных объектов
