Hello,
I’m wondering how I can detect if a JS script is working within a Cloudflare Worker runtime? This would be similar to detecting if JS is in Node. I stumbled onto a situation where an SSR dependency was using the following function to check for Node and block browser-specific logic:
var isNode = typeof global !== 'undefined' && {}.toString.call(global) === '[object global]';
I’m looking for a way to reasonably and safely do the same for CFWs so that I can correctly patch the issue for other CF users.
David