Skip to content

Feature Request: Built-In Web Libraries (BWL) via browser-lib attribute #11376

Open
@TTMTT

Description

@TTMTT

What problem are you trying to solve?

Proposal: Built-In Web Libraries (BWL) via browser-lib Attribute

Summary

This proposal introduces a new optional HTML attribute, browser-lib, to <script> and <link> elements, enabling modern browsers to natively serve popular open-source libraries (e.g., jQuery, Bootstrap, Tailwind CSS) directly from within the browser binary, rather than fetching them from the network. The attribute uses the following format:

<script src="..." browser-lib="[email protected]"></script>
<link href="..." browser-lib="[email protected]" rel="stylesheet">

Motivation

Web developers across the globe rely heavily on a small number of widely used frontend libraries. These include:

  • jQuery (used by millions of sites)
  • Bootstrap (used for UI/UX layout and components)
  • Tailwind CSS (popular utility-first framework)

Despite widespread usage and relatively static versions in production, every website still fetches its own copy of these libraries, leading to:

  • Unnecessary bandwidth consumption
  • Redundant storage and caching
  • Slower page load times
  • Increased data usage, especially on mobile networks

Built-In Web Libraries (BWL) solves this by embedding selected versions of these libraries directly inside the browser. With a simple browser-lib hint, developers can request the browser to use its built-in copy, falling back to external loading if not available.


How It Works

  1. The developer includes the browser-lib attribute with the desired library name and exact version:

    <script src="/fallback/jquery.js" browser-lib="[email protected]"></script>
  2. If the browser supports this feature and includes [email protected] internally:

    • It ignores the external src
    • Injects the native library directly into the DOM
  3. If not:

    • The browser loads from the src or href path as normal (graceful fallback)

Browser Storage Considerations

  • Libraries are bundled within the browser itself as part of its installation or update package

  • Stored in a read-only, signed, compressed format

  • Only stable and commonly used versions are included to avoid bloat

  • Examples:

    • jQuery 3.6.0
    • Bootstrap 5.3.2
    • Tailwind CSS 3.4.1
  • Total estimated space usage: ~30MB

  • No network access required — ensures perfect load speed and consistency


Benefits

  • Zero-latency load for embedded libraries
  • Reduced bandwidth for both clients and servers
  • Eco-friendly: Less global data transfer
  • Security: Controlled and verified versions only
  • Developer freedom: Still able to override by simply omitting browser-lib

Security and Compatibility

  • Only libraries with open-source licenses, wide adoption, and stable release cycles are eligible

  • Strict version matching, no wildcards or loose versioning

  • Fully backward compatible:

    • Browsers that do not recognize browser-lib will simply use the standard src or href
    • No runtime errors or behavioral inconsistencies

Example Usage

<!-- Load Bootstrap 5.3.2 from browser, fallback to vendor folder -->
<link rel="stylesheet" href="/vendor/bootstrap.css" browser-lib="[email protected]">

<!-- Load Tailwind CSS 3.4.1 if available -->
<link rel="stylesheet" href="/vendor/tailwind.css" browser-lib="[email protected]">

<!-- Load jQuery 3.6.0 from built-in bundle -->
<script src="/vendor/jquery.js" browser-lib="[email protected]"></script>

Naming and Specification

This mechanism is referred to as Built-In Web Libraries (BWL).
The proposed HTML attribute is:

browser-lib="library@version"

Supported elements:

  • <script>
  • <link rel="stylesheet">

Conclusion

Built-In Web Libraries (BWL) represent a lightweight, forward-compatible enhancement to the modern web stack. By leveraging the enormous redundancy of frontend libraries across websites, browsers can unlock tremendous performance, reduce global data waste, and enhance user experience, all without breaking existing standards.

We invite the Chromium team and web standards community to consider integrating this proposal for a faster, leaner, and more efficient web.

What solutions exist today?

No response

How would you solve it?

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    addition/proposalNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interest

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions