upon pop-up opening, retrieve clipboard in the next animation frame
authorDamyan Ivanov <dmn@debian.org>
Mon, 19 Jun 2017 14:48:21 +0000 (14:48 +0000)
committerDamyan Ivanov <dmn@debian.org>
Mon, 19 Jun 2017 14:48:21 +0000 (14:48 +0000)
otherwise the Paste command returns error. the focusing also doesn't work.
bummer.

a 250ms timeout also seems to work

icedeb.js

index 338f292..b730d26 100644 (file)
--- a/icedeb.js
+++ b/icedeb.js
@@ -190,5 +190,7 @@ window.addEventListener('DOMContentLoaded', (e) => {
     save_settings();
   });
 
-  get_clipboard_contents();
+  window.requestAnimationFrame(()=>{
+    window.requestAnimationFrame(get_clipboard_contents);
+  });
 });