code: function (ref) {
    try {
      if ((typeof window.maccocojs !== 'undefined') && (typeof window.maccocojs === 'object') && window.maccocojs.hasOwnProperty('app')) {
        ref.pN = ref.pNative = window.maccocojs; // 原MacOSX本地引擎
        ref.pIsUseMacCocoEngine = true;
        ref.pIsUseElectron = false;
      } else if ((typeof process === 'object') && (typeof require === 'function') && (process.hasOwnProperty('pid'))) {
        try {
          console.log('============= must first load =================');
          try {
            window['eletron_require'] = window.require;
            window['eletron_module'] = window.module;
  
            // Electron引擎加载方式，兼容新的及老的版本。支持：最新1.1.3和0.34版本系列
            try {
              window['eval'] = window.eval || function (params) {
                console.log('--------- eval function is not actual');
              };
              var js = "try{window.require(\"remote\").require(\"./romanysoft/maccocojs\")}catch(e){}";
              ref.pN = ref.pNative = window['eval'](js);
            } catch (error) {
              try {
                var js$1 = "try{window.require(\"electron\").remote.require(\"./romanysoft/maccocojs\")}catch(e){}";
                ref.pN = ref.pNative = window['eval'](js$1);
              } catch (e) {
                console.error(e);
              }
            }
  
            // 重新处理require,module的关系
            window.require = undefined;
            // window.module.exports = undefined
            window.module = undefined;
          } catch (error) {
            console.error(error);
          }
          ref.pIsUseElectron = true;
          ref.pIsUseMacCocoEngine = false;
          console.log('============= must first load [end]=================');
        } catch (error) {
          console.error(error);
        }
      }
    } catch (error) {
      console.error(error);
    }
  
    return ref
  }
docs: 自动匹配检测