CCDirectLink / CCLoader

Modloader for crosscode
35 stars 11 forks source link

simplify: Fix running in a browser. #88

Closed L-Sherry closed 3 years ago

L-Sherry commented 3 years ago

simplify tries to check if it is running in a browser by attempting to check for window.require. But ccloader/js/normalize.js ensures that window.require always exists, so the check always fails.

As a replacement, check that 'nw.gui' can be loaded.

dmitmel commented 3 years ago

Btw, alternatively the presence of the nw object can be checked. require('nw.gui') is the old method of accessing that object (as stated by the nwjs docs, don't remember where).