plume/cross_origin_opener_policy

Cross-Origin Opener Policy (COOP)

This response header controls whether a top-level document shares a browsing context group with cross-origin documents that open it or that it opens. Required alongside Cross-Origin-Embedder-Policy to enable cross-origin isolation.

See the MDN docs.

Types

A Cross-Origin-Opener-Policy header value.

pub type CrossOriginOpenerPolicy {
  UnsafeNone
  SameOrigin
  SameOriginAllowPopups
  NoOpenerAllowPopups
}

Constructors

  • UnsafeNone

    Allows the document to share a browsing context group with its opener. Browser default.

  • SameOrigin

    Isolates the browsing context to same-origin documents. Plume default.

  • SameOriginAllowPopups

    Like SameOrigin, but keeps references to popups that either don’t set the header or set it to UnsafeNone.

  • NoOpenerAllowPopups

    Newly-opened cross-origin documents are loaded in a new browsing context group. Same-origin documents, and cross-origin documents not opened from this one, are unaffected.

Values

pub fn to_string(value: CrossOriginOpenerPolicy) -> String

Encode as the Cross-Origin-Opener-Policy header value.

Search Document