CodeMeltedDEV
    Preparing search index...

    Class CEmbeddedFrame

    Embedded responsive iframe widget with adaptive launch controls. Fills 100% of its parent container by default while providing theming overrides and standard iframe permission policies.

    HTML Usage:

    <cm-embedded-frame
    frame_src="[https://example.com/embed](https://example.com/embed)"
    open_src="[https://example.com/post](https://example.com/post)"
    label="Embedded Content Viewer"
    allow="camera; microphone; fullscreen; display-capture"
    sandbox="allow-scripts allow-same-origin allow-forms"
    ></cm-embedded-frame>

    Exposed CSS Custom Properties:

    cm-embedded-frame {
    // Dimensions (Defaults to 100%)
    --width: 100%;
    --height: 600px;

    // Controls Layout & Typography
    --controls-padding: 8px 0;
    --controls-gap: 12px;
    --label-color: CanvasText;
    --label-font-size: 13px;

    // Action Button
    --btn-bg: #2563eb;
    --btn-hover-bg: #1d4ed8;
    --btn-active-bg: #1e40af;
    --btn-color: #ffffff;
    --btn-border: none;
    --btn-border-radius: 6px;
    --btn-padding: 0 16px;
    --btn-height: 32px;
    --btn-font-size: 13px;
    --btn-font-weight: 600;

    // Switch Control
    --switch-track-bg: rgba(125, 125, 125, 0.35);
    --switch-active-bg: #2563eb;
    --switch-knob-bg: #ffffff;
    --switch-focus-ring: #2563eb;

    // Frame Container
    --frame-border: 1px solid rgba(125, 125, 125, 0.2);
    --frame-border-radius: 6px;
    }

    Hierarchy (View Summary)

    Index
    observedAttributes: string[] = ...
    • Called when attributes are changed, added, removed, or replaced.

      Parameters

      • name: string

        The name of a observedAttributes allowing access into the internals of the custom component.

      • old_value: string

        The original value held by the attribute.

      • new_value: string

        The new value to apply.

      Returns void

    • Called each time the element is added to the document. The specification recommends that, as far as possible, developers should implement custom element setup in this callback rather than the constructor.

      Returns void

    • When defined, this is called instead of connectedCallback() and disconnectedCallback() each time the element is moved to a different place in the DOM via Element.moveBefore(). Use this to avoid running initialization/cleanup code in the connectedCallback() and disconnectedCallback() callbacks when the element is not actually being added to or removed from the DOM. See Lifecycle callbacks and state-preserving moves for more details.

      Returns void

    • The get_attribute() method of the Element interface returns the string value of the specified attribute of the specified element. It returns null if the element doesn't have an attribute with the given name.

      Parameters

      • name: string

        A string specifying the name of the attribute. When called on an HTML element in a DOM flagged as an HTML document, the name is normalized to lowercase.

      Returns string | null

      A string containing the attribute's value, or null if the element doesn't have an attribute with the given name.

    post_message

    • post_message(data: any, target_origin?: string): void

      Posts a structured message to the embedded iframe window.

      Parameters

      • data: any

        Data payload to post.

      • Optionaltarget_origin: string = "*"

        Target origin restriction.

      Returns void

    • The set_attribute() method of the Element interface sets the value of an attribute on the specified element. If the attribute already exists, the value is updated; otherwise a new attribute is added with the specified name and value.

      Parameters

      • name: string

        A string containing the qualified name of the attribute whose value is to be set. The attribute name is automatically converted to all lower-case when set_attribute() is called on an HTML element in an HTML document.

      • value: string

        A trusted type or string containing the value to assign to the attribute.

      Returns void

    • Utility function to register a custom component if it has not already been defined.

      Parameters

      • name: string

        The name of the component.

      • element_def: any

        The constructor definition.

      Returns void