codemenschen / werk-probe
Lets Werk, the Codemenschen support app, show the site in its frame with the page picker for bug reports. Read only.
Requires
- php: ^8.1
- illuminate/http: ^10.0|^11.0|^12.0|^13.0
- illuminate/routing: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0|^10.0|^11.0
- phpunit/phpunit: ^10.5|^11.0|^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
codemenschen/werk-probe lets Werk, the Codemenschen support app, show the site in its page
report frame with the element picker and the scroll position (API.md 4.7.3). It reads nothing
and writes nothing. Installing it is the whole setup.
Install
composer require codemenschen/werk-probe
Package discovery registers the service provider, which adds one global middleware. Deploy as
usual. To switch it off without removing it, set WERK_PROBE_ENABLED=false.
What it does
Only when a page loads into a frame (the browser sends Sec-Fetch-Dest: iframe) and the response
is HTML:
- removes
X-Frame-Optionsand addsContent-Security-Policy: frame-ancestors 'self' https://werk.codemenschen.at. A policy the site sends itself is kept; browsers apply every policy, so this never widens one. - adds
<script id="werk-probe-picker" src="https://werk.codemenschen.at/probe.js" defer>before</body>, with the Vite CSP nonce when the site uses one.
Every other request passes untouched. The script itself does nothing unless the page sits in a frame of the Werk app, and talks to that origin only.
Sites that are not rendered by Laravel
A static or JavaScript front end (Astro, Vue, plain HTML) with Laravel only as its API needs no package. Add this line to the layout instead:
<script src="https://werk.codemenschen.at/probe.js" defer></script>
If the site sends X-Frame-Options or a frame-ancestors policy, allow
https://werk.codemenschen.at there as well.
Config
php artisan vendor:publish --tag=werk-probe-config copies config/werk-probe.php:
enabled, app_origin, script_url (env WERK_PROBE_ENABLED, WERK_PROBE_APP_ORIGIN,
WERK_PROBE_SCRIPT_URL).
Tests
composer install && vendor/bin/phpunit