@x-govuk/edit-prototype-in-browser

0.3.2 • Public • Published

Edit prototype in browser

This is a plugin to the govuk-prototype-kit which adds an in-browser editor.

Requirements

This works with the GOV.UK Prototype Kit v13.0.0 and above.

Phase: Beta

This is a beta product, we know that improvements need making and we'd like your feedback.

Configuration

If you want to have the editor on some pages but not others you can turn the editor off for by adding this near the top of your page:

<script>
  window.XGOVUK = window.XGOVUK || {}
  window.XGOVUK.editPrototypeInBrowser = window.XGOVUK.editPrototypeInBrowser || {}

  window.XGOVUK.editPrototypeInBrowser.doNotEditThisPage = true
</script>

Currently the editor shows when you're running on localhost but not on other domains, if you want it to work on different domains you can add them like this:

<script>
  window.XGOVUK = window.XGOVUK || {}
  window.XGOVUK.editPrototypeInBrowser = window.XGOVUK.editPrototypeInBrowser || {}

  window.XGOVUK.editPrototypeInBrowser.allowedDomains = ['example.com', 'another-domain.net']
</script>

Issues and feedback

[https://github.com/x-govuk/edit-prototype-in-browser/issues]

Dependencies (5)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @x-govuk/edit-prototype-in-browser

    Weekly Downloads

    2

    Version

    0.3.2

    License

    ISC

    Unpacked Size

    23 kB

    Total Files

    14

    Last publish

    Collaborators

    • nataliecarey
    • paulrobertlloyd
    • frankieroberto
    • fofr