Skip to content

[Feat]: Reuse the "#cc-main" element where possible #799

@codebymikey

Description

@codebymikey

Description

This is useful for sites which might want the cookie consent form to be rendered in a specific place on the page, e.g. above the rest of the page content e.g. https://www.gov.uk/

Image

Proposed solution

The site can declare a placeholder <div id="cc-main"></div> on the page.
The library should then check if the #cc-main element exists on the page, and reuse it rather than creating a duplicate.

dom._ccMain = createNode(DIV_TAG);
dom._ccMain.id = 'cc-main';

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageyet to be reviewed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions