Search by

codemenschen / werk-probe

codemenschendev

Lets Werk, the Codemenschen support app, show the site in its frame with the page picker for bug reports. Read only.

v1.1.0 2026-09-19 02:19 UTC

This package is auto-updated.

Last update: 2026-09-19 02:34:10 UTC


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-Options and adds Content-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