mskocik/tracy-reloader
Composer 安装命令:
composer require mskocik/tracy-reloader
包简介
Automatic page refresh - watching changes with SSE or connect your LiveReload server
README 文档
README
Tracy extension for automatic page live update or refresh through LiveReload
Installation
composer require --dev mskocik/tracy-reloader
Add to Tracy
tracy:
bar:
- Mskocik\TracyReloader\ReloaderPanel(<mode>, <options>, <excludeHeaders>)
Config
Extension supports 2 modes: LiveReload or Server Sent Events
LiveReload
// minimal setup Mskocik\TracyReloader\ReloaderPanel('LR', [ 'https' => false, // when accessing LiveReload server from https host 'host' => null, // when NULL, pick visited hostname 'port' => 35729, 'path' => 'livereload', // internal 'excludeHeaders' => [], // additional header definition for AJAX requests exclusion ]);
Filter ajax requests
It is not desired to render Reloader panel for AJAX requests. Because you want only ONE active instance, which should happen only on full page load/reload. Basic AJAX requests are filtered out automatically, but if you send some additional AJAX requests, you can filter them out by specifying headers that are related to these requests.
These headers should be specified in excludedHeaders property of $config as $key: $value pairs.
Example of local.neon, when app is using swup.js for app navigation:
tracy:
bar:
- Mskocik\TracyReloader\ReloaderPanel(mode: 'LR', config: [
https: true,
excludeHeaders: [
x-requested-with: swup
]
])
统计信息
- 总下载量: 68
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-03-22