forked from DebaucheryLibrarian/traxxx
Added PornPros satellite sites.
This commit is contained in:
23
src/utils/ex.js
Normal file
23
src/utils/ex.js
Normal file
@@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
const { JSDOM } = require('jsdom');
|
||||
|
||||
function q(context, selector) {
|
||||
return context.querySelector(selector);
|
||||
}
|
||||
|
||||
function qa(context, selector) {
|
||||
return Array.from(context.querySelectorAll(selector));
|
||||
}
|
||||
|
||||
function ex(html) {
|
||||
const { document } = new JSDOM(html).window;
|
||||
|
||||
return {
|
||||
document,
|
||||
q: selector => q(document, selector),
|
||||
qa: selector => qa(document, selector),
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = ex;
|
||||
Reference in New Issue
Block a user