You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
366 B
JavaScript
13 lines
366 B
JavaScript
import { MediumExtractor, BloggerExtractor } from './custom';
|
|
|
|
const Detectors = {
|
|
'meta[name="al:ios:app_name"][value="Medium"]': MediumExtractor,
|
|
'meta[name="generator"][value="blogger"]': BloggerExtractor,
|
|
};
|
|
|
|
export default function detectByHtml($) {
|
|
const selector = Reflect.ownKeys(Detectors).find(s => $(s).length > 0);
|
|
|
|
return Detectors[selector];
|
|
}
|