SvenWerlen / moulinette-tiles

Moulinette Forge submodule which provides capabilities for importing and managing tiles
https://www.patreon.com/moulinette
MIT License
2 stars 4 forks source link

TypeError: navigator.clipboard is undefined #6

Closed TPNils closed 2 years ago

TPNils commented 2 years ago

I receive an error when trying to use the Clipboard function of the tiles. It appears this issue happens on http connections and supposedly this should be the fix, though I have not tried it myself https://stackoverflow.com/questions/51805395/navigator-clipboard-is-undefined

TypeError: navigator.clipboard is undefined
    _updateObject http://192.168.0.11:30000/modules/moulinette-tiles/modules/moulinette-tileresult.js:89
    _onSubmit http://192.168.0.11:30000/scripts/foundry.js:2825
foundry.js:2828:15
    _onSubmit http://192.168.0.11:30000/scripts/foundry.js:2828
SvenWerlen commented 2 years ago

When you access your server, could you try using http://localhost:30000 rather than http://192.168.0.11:30000. The clipboard function only works if you're on a secure server (https) or "localhost". I'll also improved the exception handling in the module to show a 'warning' when the navigator clipboard is not available AND a workaround for the clipboard function from the toolbar.