function findAll(window, sels) {
    const { document } = window;

    // Unwrap noscript elements.
    const elements = document.getElementsByTagName('noscript');
    Array.prototype.forEach.call(elements, (ns) => {
        const wrapper = document.createElement('div');
        wrapper.innerHTML = ns.textContent;
        // Insert each child of the <noscript> as its sibling
        Array.prototype.forEach.call(wrapper.children, (child) => {
            ns.parentNode.insertBefore(child, ns);
        });
    });

    // Do the filtering.
    return sels.filter((selector) => {
        try {
            return document.querySelector(selector);
            // eslint-disable-next-line no-unused-vars
        } catch (e) {
            // We ignore the error because there are a bunch of selectors which are out of our control.
            // In that case, we consider them as unused.
            return true;
        }
    });
}
Filter unused selectors.
@param  {Object}  window A jsdom window
@param  {Array}   sels   List of selectors to be filtered
@return {Array}