Web Protocols

Free, open-source JavaScript tools with zero dependencies. Powered by AI. Use in any project — even commercially.

Free for Commercial Use Zero Dependencies Under 3 KB each Powered by AI
Try Live Demo Download View on GitHub

Three Tools. Zero Dependencies.

Each tool solves one problem perfectly. Use one or all three.

URL State Compact

Save any JavaScript object into the URL with compression. Create shareable links that restore full app state — no backend, no database, just a URL.

~2 KBCompressionFramework-agnostic

Web Editor Live

A visual CSS editor that lets users customize any website. Point-and-click element selection, edit styles, and everything saves to localStorage automatically.

~3 KBVisual UIlocalStorage

Data Guard Lite

Validate data before saving to localStorage or sessionStorage. Built-in validators for emails, URLs, numbers — plus custom rules and regex support.

~1 KBCustom Rules10+ Validators

Try It Live

No install needed. Everything runs right here in your browser.

URL State
Web Editor
Data Guard

URL State — Save Data in the URL

Fill in the fields, click Save to URL, and watch the address bar change. Copy the link and send it to anyone — they will see your exact data.

Enter some data and click "Save to URL". The URL will update with compressed state. Share the link — it restores everything.

Web Editor — Customize This Page

Click Activate to open the editor panel. Then click Select in the panel and click any element on this page to customize its styles. Changes persist in localStorage.

Click "Activate" to start the visual editor. Change colors, fonts, spacing, borders, and more. Everything persists across page reloads.

Data Guard — Validate Before Saving

Try valid and invalid data. Data Guard checks everything before saving to localStorage.

Enter data and click "Validate and Save". Try invalid data to see validation errors. Rules applied: email -> valid email format, not empty age -> positive integer website -> valid URL username -> regex /^[a-z0-9_]{3,20}$/

Download

Each tool is a single file. Drop it into your project and start using it.

url-state-compact

~2 KB — Pure JavaScript — Zero dependencies
<script type="module">
  import { saveToUrl, loadFromUrl }
    from './url-state/src/index.js';
</script>
Source

web-editor-live

~3 KB — Pure JavaScript — Zero dependencies
<script type="module">
  import { init }
    from './web-editor/src/index.js';
  init();
</script>
Source

data-guard-lite

~1 KB — Pure JavaScript — Zero dependencies
<script type="module">
  import { rule, guardedSet }
    from './data-guard/src/index.js';
</script>
Source

Or clone the entire repository:

git clone https://github.com/vbtronic/web_protocols.git

Integration Protocol

Step-by-step guide to add Web Protocols into your website or product.

Get the files

Download only the tools you need, or clone the whole repo. Each tool is a single .js file.

git clone https://github.com/vbtronic/web_protocols.git

# or download individual files from the Download section
# or use CDN links directly

Add to your project

Copy the .js file into your project folder. No npm install, no build step.

your-project/
  index.html
  js/
    url-state.js      <-- paste here
    web-editor.js     <-- paste here
    data-guard.js     <-- paste here

Import in your HTML

Add a script tag with type="module" and import the functions you need.

<script type="module">
  import { saveToUrl, loadFromUrl } from './js/url-state.js';
  import { init } from './js/web-editor.js';
  import { rule, guardedSet } from './js/data-guard.js';
</script>
You can also load directly from CDN without downloading:
import { saveToUrl } from 'https://vbtronic.github.io/web_protocols/packages/url-state/src/index.js';

Use in your code

Call the functions wherever you need them. Everything works client-side, no setup required.

// Save form state to URL for sharing
document.getElementById('save-btn').onclick = () => {
  const data = {
    search: document.getElementById('search').value,
    filter: document.getElementById('filter').value,
    page: currentPage
  };
  saveToUrl(data);
};

// Restore state when page loads
const state = loadFromUrl();
if (state) {
  document.getElementById('search').value = state.search;
  document.getElementById('filter').value = state.filter;
  currentPage = state.page;
}

Done — ship it

No build step needed. Works in all modern browsers. Your users get shareable links, customizable UI, or validated storage — depending on which tools you chose.

Remember: you are free to use these tools in any commercial or personal project. See the Terms section for the full license.

Real-World Integration Examples

E-commerce Filters

Let users share product filter combinations via URL.

import { saveToUrl, loadFromUrl }
  from './url-state.js';

// When filters change
function onFilterChange() {
  saveToUrl({
    category: 'shoes',
    size: [40, 42],
    color: 'black',
    sort: 'price-asc',
    page: 1
  });
}

// On page load
const f = loadFromUrl();
if (f) applyFilters(f);

White-Label Theming

Let clients customize your product's look without code.

import { init, applySaved }
  from './web-editor.js';

// On every page load — apply
// client's saved customizations
applySaved();

// Admin page — show editor
if (isAdmin) {
  init();
}

User Settings Form

Validate user input before persisting to storage.

import { rule, guardedSet }
  from './data-guard.js';

const rules = [
  rule('name', 'string', 'nonempty'),
  rule('email', 'email'),
  rule('age', 'int', 'positive'),
  rule('website', 'url'),
];

const result = guardedSet(
  'settings', formData, rules
);
if (!result.saved) {
  showErrors(result.errors);
}

Help Center

Everything you need to get started and troubleshoot.

Getting Started

The fastest way to use Web Protocols:

  • Download the .js file you need (or clone the repo)
  • Add a <script type="module"> tag to your HTML
  • Import the functions you need
  • Done — no build tools, no npm, no config
<script type="module">
  import { saveToUrl } from './index.js';
  saveToUrl({ page: 1, filter: 'new' });
</script>

URL State — Quick Guide

Store and restore state from the URL:

  • saveToUrl(obj) — saves object to URL
  • loadFromUrl() — reads object from URL
  • createUrl(base, obj) — builds a shareable link
  • encodeState(obj) — returns compressed string
  • decodeState(str) — decompresses back to object

URL parameter key defaults to s. Pass a custom key as the second argument.

Web Editor — Quick Guide

Add a visual CSS editor to any page:

  • init() — opens the editor panel
  • applySaved() — applies saved styles silently
  • getStyles() — returns all stored overrides
  • clearStyles() — removes all saved styles

Styles are saved per CSS selector in localStorage under the key web-editor-live-styles.

Data Guard — Quick Guide

Validate data before saving:

  • rule('field', ...checks) — define a rule
  • validate(data, rules) — check without saving
  • guardedSet(key, data, rules) — validate + save
  • createGuard(rules) — reusable storage wrapper
  • addValidator(name, fn) — add custom validators

Built-in checks: string, number, boolean, email, url, nonempty, array, object, int, positive

Browser Compatibility

Web Protocols works in all modern browsers:

  • Chrome / Edge 80+
  • Firefox 78+
  • Safari 14+
  • Any browser with ES Module support

No polyfills needed. No transpilation required.

Need More Help?

If you run into issues or have questions:

Contributions are welcome. Feel free to submit a Pull Request.

Frequently Asked Questions

Is it really free for commercial use?
Yes. You can use all tools in commercial websites, apps, and SaaS products at no cost. The only restriction is you cannot resell the tools themselves as a standalone product or claim you created them.
Do I need npm or a build tool?
No. Each tool is a single JavaScript file with zero dependencies. Just download the file, add a script tag with type="module", and import the functions you need. No npm, no webpack, no config.
How much data can the tools store?
URL State Compact is limited by URL length (~2,000 characters) — with compression, that fits about 500–1,000 characters of JSON, enough for filters, forms, and settings. Web Editor Live and Data Guard Lite use localStorage, which has a much higher limit (~5–10 MB depending on the browser) — plenty for saved styles and validated data.
Does Web Editor work on any website?
Yes. It works with any HTML page. You can add it to your own site, or use the bookmarklet version to customize third-party sites. Styles are stored per-site in localStorage.
Is any data sent to a server?
No. All three tools run 100% client-side. Nothing is ever sent to any server. URL State stores data in the URL bar, Web Editor and Data Guard use localStorage. There are no cookies, no analytics, no tracking.
What does "Powered by AI" mean?
The development of Web Protocols was accelerated using AI tools. The code is human-reviewed, tested, and maintained by the author. AI was used as a development aid, not a replacement for quality engineering.

Settings

Customize this website. This section itself uses Web Protocols tools.

Language

Switch the website language. Your preference is saved to localStorage using Data Guard.

This language preference is validated and saved using data-guard-lite — our own Product 3 in action.

Appearance

Customize the look of this website. Uses Web Editor Live under the hood.


Open the point-and-click CSS editor

Remove all saved style changes
This section uses web-editor-live — our own Product 2. We use our own tools on our own website.

License and Terms

Simple rules. Use freely, just do not resell or claim as yours.

What You CAN Do

  • Use all tools freely in your personal and commercial projects
  • Modify the source code to fit your needs
  • Include the tools as part of a larger product, website, or application
  • Use in client projects — no attribution required in the UI

What You CANNOT Do

  • Redistribute or publish the tools as a standalone product or library
  • Claim authorship — do not present this software as your own creation
  • Sell the tools themselves as a standalone commercial product
  • Remove the copyright notice from the source files

In Simple Terms

Use it inside your projects for free — websites, apps, SaaS products, anything. Just do not take the library itself and sell it or republish it as if you made it.

License Type

Modified MIT License. See the full LICENSE file on GitHub.

Privacy

All tools run 100% client-side. No data is ever sent to any server. No cookies, no analytics, no tracking. URL State stores data in the URL. Web Editor and Data Guard store data in localStorage.

Contact

Questions? Open an issue on GitHub or reach out to @vbtronic.