Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

启动报"ReferenceError: Browser is not defined" #447

Closed
longhaoteng opened this issue Dec 7, 2018 · 0 comments
Closed

启动报"ReferenceError: Browser is not defined" #447

longhaoteng opened this issue Dec 7, 2018 · 0 comments

Comments

@longhaoteng
Copy link

longhaoteng commented Dec 7, 2018

问题描述

在electron项目中引入anyproxy作为npm模块使用

环境:

macOS Mojave 10.14.1 (18B75)
"anyproxy": "^4.0.12"
"electron": "^3.0.10"

代码:

import AnyProxy from 'anyproxy' 
const options = {
        port: 8001,
        rule: {
          summary: 'a rule to hack response',
          *beforeSendResponse (requestDetail, responseDetail) {
            return null
          }
        },
        webInterface: {
          enable: true, 
          webPort: 8002
        },
        throttle: 10000, 
        forceProxyHttps: false, 
        wsIntercept: false,
        silent: false 
      }
      const proxyServer = new AnyProxy.ProxyServer(options)

      proxyServer.start()

      proxyServer.on('ready', () => {
        console.log('proxy启动成功')
      })
      proxyServer.on('error', e => {
        console.log(e)
      })

错误日志

ReferenceError: Browser is not defined
    at Va (VM1388 encode.js:49)
    at Object.<anonymous> (VM1388 encode.js:50)
    at Object.<anonymous> (VM1388 encode.js:59)
    at Module._compile (internal/modules/cjs/loader.js:711)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:722)
    at Module.load (internal/modules/cjs/loader.js:620)
    at tryModuleLoad (internal/modules/cjs/loader.js:559)
    at Function.Module._load (internal/modules/cjs/loader.js:551)
    at Module.require (internal/modules/cjs/loader.js:658)
    at require (internal/modules/cjs/helpers.js:20)
    at Object.<anonymous> (VM1387 compress.js:1)
    at Object.<anonymous> (VM1387 compress.js:45)
    at Module._compile (internal/modules/cjs/loader.js:711)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:722)
    at Module.load (internal/modules/cjs/loader.js:620)
    at tryModuleLoad (internal/modules/cjs/loader.js:559)

相关问题

#368
foliojs/brotli.js#20 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant