Get code not to run if webpage is of SPA type

Viewed 16

I am writing a Chrome extension which modifies the body of the HTML.

document.addEventListener('DOMContentLoaded', () =>
{
    const body = document.body.innerHTML;    
    let body_edited = foo();
    document.body.innerHTML = body_edited;
});

I want my code not to modify the document body if the webpage is an SPA kind of website - like written in React, Vue, Angular etc. How do I detect if a webpage is of certain kind ?

0 Answers
Related