import React from 'dom-chef'; import select from 'select-dom'; import * as pageDetect from 'github-url-detection'; import features from '.'; const isSingleHTMLFile = (): boolean => pageDetect.isSingleFile() && /\.html?$/.test(location.pathname); function init(): void { const rawButton = select('#raw-url')!; rawButton .parentElement! // `BtnGroup` .prepend( Preview ); } void features.add(__filebasename, { include: [ isSingleHTMLFile ], exclude: [ pageDetect.isEnterprise ], init });