for perf and shorter code, check for doc.addEventListener only once and store it in 'modern' (@shimsharf)