Idea: A JavaScript API for dynamically turning on all `<noscript>` elements on the page


#1

Less than 1% of users have JavaScript disabled. On the other hand, pretty much everyone has a bad connection at least some of the time. Would it be possible to re-purpose the <noscript> element, so that it can become active dynamically when a web page’s JavaScript resources fail to load or load very slowly?

I don’t have any specific use cases (yet). I just wanted to put this idea out there to check if it makes any sense at all. The API could be a global flag:

document.noscript = true;

The web page could set this flag from an inline script if it detects that its JS resources failed to load after a specific amount of time. One user on Twitter also suggested this API 1:

location.reload({ noscript: true });

In addition to activating all <noscript> elements on the page, the browser would also make sure to finish loading JS resources (for future page loads) but not to execute them on the current page.