Skip to content

Using js-cookie on third party sites / noConflict #646

@unuseless

Description

@unuseless

The bug happens in the following circumstance:

A site uses requirejs for loading js (called parent site). In this parent site third party javascript snippets are used. The third party scripts (i.e. js based polls, popups, counters, ...) have no access to the requirejs loading environment of the parent site.

js-cookie is used in such a third party script. Because the third party script does not know in which environment js-cookie is loaded, they should use the noConflict method. That works well if the parent site does not use requirejs. However if the parent site uses requirejs, the noConflict method throws an error because it is not exported.

This issue is very similar to #234 .

Expected behavior
js-cookie allows noConflict under all circumstances, even if the host site uses requirejs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions