https://github.com/hiproxy/open-browser
Open browser window and set proxy
https://github.com/hiproxy/open-browser
Last synced: 11 months ago
JSON representation
Open browser window and set proxy
- Host: GitHub
- URL: https://github.com/hiproxy/open-browser
- Owner: hiproxy
- License: mit
- Created: 2017-05-24T04:40:56.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T06:01:02.000Z (over 5 years ago)
- Last Synced: 2024-11-29T07:42:46.430Z (over 1 year ago)
- Language: JavaScript
- Size: 19.5 KB
- Stars: 12
- Watchers: 3
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# open-browser
Open browser window and set proxy
# Install
```bash
npm install op-browser --save
```
# Usage
```js
const openBrowser = require('op-browser');
// Automatic proxy selection
openBrowser.open('chrome', 'https://google.com', 'http://127.0.0.1:8800', '');
// Proxy auto-configuration (PAC)
openBrowser.open('chrome', 'https://google.com', '', 'http://127.0.0.1:8800/proxy.pac');
```
# API
## op-browser : object
Browser
**Kind**: global namespace
* [op-browser](#op-browser) : object
* [.open(browser, url, proxyURL, pacFileURL)](#op-browser.open) ⇒ Promise
* [.detect(name)](#op-browser.detect) ⇒ Promise
### op-browser.open(browser, url, proxyURL, pacFileURL, bypassList) ⇒ Promise
open browser window, if the `pacFileURL` is not empty, will use `proxy auto-configuration`
**Kind**: static method of [op-browser](#op-browser)
| Param | Type | Description |
| --- | --- | --- |
| browser | String | the browser's name |
| url | String | the url that to open |
| proxyURL | String | the proxy url, format: `http://[:[port]]` |
| pacFileURL | String | the proxy url, format: `http://[:[port]]/[pac-file-name]` |
| bypassList | String | the list of hosts for whom we bypass proxy settings and use direct connections, See: "[net/proxy/proxy_bypass_rules.h](https://cs.chromium.org/chromium/src/net/proxy_resolution/proxy_bypass_rules.h?sq=package:chromium&type=cs)" for the format of these rules |
### op-browser.detect(name) ⇒ Promise
detect browser, return the browser's path
**Kind**: static method of [op-browser](#op-browser)
| Param | Type | Description |
| --- | --- | --- |
| name | String | the browser name |