ZeroClipboard: swf loaded, but not working

前端 未结 5 1059
旧时难觅i
旧时难觅i 2021-02-14 05:51

ZeroClipboard doesn\'t work and it doesn\'t throw any errors (javascript console).

The website is hosted on a HTTPS webserver running on localhost. Both the website and

5条回答
  •  伪装坚强ぢ
    2021-02-14 06:39

    After months I finally found a solution:

    ZeroClipboard doesn't work out-of-the-box in CommonJS environments in the browser, even it says it does.

    The fix for that is assigning the module scope variable (e.g. ZeroClipboard) to the global window object:

    ZeroClipboard = require("zeroclipboard");
    window.ZeroClipboard = ZeroClipboard;
    

    I created a bug report on this: https://github.com/zeroclipboard/zeroclipboard/issues/332

提交回复
热议问题