Comments (5)
Hi,
I’m not sure I understand your question (feel free to rephrase the question in Chinese).
I suppose you’re looking for the documentation of the ‘opts’ object. It is intended to pass down to the “open” library (formerly known as “opn”) when launching with AppleScript doesn’t work out.
https://github.com/ExiaSR/better-opn/blob/master/src/index.js#L67
Please refer to their docs https://www.npmjs.com/package/open
from better-opn.
使用场景
当我使用nodemon的时候 每次会自动刷新当前tab 我不希望刷新 不知道有没有配置项可以禁用自动刷新?
from better-opn.
https://github.com/ExiaSR/better-opn/blob/c5d60ea88ba1f000f3bbc8fbbc0e97be239bb47b/src/index.js#L43
我想我也许想修改的是这个object
from better-opn.
https://github.com/ExiaSR/better-opn/blob/c5d60ea88ba1f000f3bbc8fbbc0e97be239bb47b/src/index.js#L43
我想我也许想修改的是这个object
Because tab reloading
is controlled by AppleScript
, there is no easy way to do customization from JS unless we include an additional AppleScript
to achieve such behaviour in the release.
I believe the ideal solution for your use case is to make path
to the AppleScript
configurable, then you may customize the behaviour as you wish.
Implementation
const startBrowserProcess = (browser, url, opts = { pathToAppleScript: '../openChrome.applescript' }) {
// ...
execSync(`osascript ${opts.pathToAppleScript} "${encodeURI(url)}"`)
// remove `pathToAppleScript` from `opts` before fallback to `open`
}
Usage
const opn = require('better-opn')
open('https://localhost:3000', { pathToAppleScript: 'full_path_to_custom_applescript' })
Feel free to open a PR if this meets your needs. I am really stressed with school work, properly won't have much availability to work on this.
from better-opn.
非常感谢您的建议 我需要查阅一下文档,再考虑如何开始~ 有时间我研究一下 谢谢~
from better-opn.
Related Issues (13)
- Pass only host to applescript HOT 1
- Instead of opening my default macOS browser, opens Ubuntu VM through Parallels with Chromium HOT 1
- Browser not opened on Windows ARM64 HOT 3
- Contribute the features back to upstream `open`? HOT 2
- [feature] Request type file HOT 1
- add googel chrome dev HOT 2
- this url will open twice
- Opening browser causes a change in the window title HOT 4
- Query on setting the default command shell HOT 1
- Colon-delimitation of commands in `BROWSER` is not respected HOT 1
- Should respect OS user preferences rather than default to a "better" browser
- Add integration test to see if tab is reused over different run.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from better-opn.