Skip to content

Describe the document.navigator security caveats in the docs #56

@nasirkhan

Description

@nasirkhan

Thanks for building this awesome tool.

I was trying to use it in one of my projects, I am using Vite to build the project.

I added the CSS and used the following code for JS.

<script type="module">
  import { init } from "https://cdn.jsdelivr.net/npm/shareon@2/dist/shareon.es.js";
  // do something
  init();
</script>

After that all the buttons worked, but copy-url throws an error when I click on that button. Even after initialization, it shows a warning ReferenceError: temp0 is not defined. The error

TypeError: navigator.clipboard is undefined
    u https://cdn.jsdelivr.net/npm/shareon@2/dist/shareon.es.js:27
    u https://cdn.jsdelivr.net/npm/shareon@2/dist/shareon.es.js:25
    <anonymous> http://localhost/products/123:417

I am testing from Firefox, I would like to mention that your demo at shareon.js.org/ works fine from the same browser.

Can you please help me to find and fix the issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions