File tree 3 files changed +6
-6
lines changed
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ const HUD = {
37
37
// Force the re-computation of styles, so Chrome sends a visibility change message to the child frame.
38
38
// See https://github.com/philc/vimium/pull/3277#issuecomment-487363284
39
39
40
- // Allow to access the clipboard through iframes.
41
- this . hudUI . iframeElement . allow = "clipboard-read" ;
40
+ // Allow to access to the clipboard through iframes.
41
+ this . hudUI . iframeElement . allow = "clipboard-read; clipboard-write " ;
42
42
getComputedStyle ( this . hudUI . iframeElement ) . display ;
43
43
} else {
44
44
this . hudUI . toggleIframeElementClasses ( "vimiumClickable" , "vimiumNonClickable" ) ;
Original file line number Diff line number Diff line change @@ -9,13 +9,13 @@ const Clipboard = {
9
9
} ,
10
10
11
11
// http://groups.google.com/group/chromium-extensions/browse_thread/thread/49027e7f3b04f68/f6ab2457dee5bf55
12
- copy ( { data} ) {
12
+ async copy ( { data} ) {
13
13
const textArea = this . _createTextArea ( ) ;
14
14
textArea . value = data . replace ( / \xa0 / g, " " ) ;
15
15
16
16
document . body . appendChild ( textArea ) ;
17
17
textArea . select ( ) ;
18
- document . execCommand ( "Copy" ) ;
18
+ await navigator . clipboard . writeText ( textArea . value ) ;
19
19
document . body . removeChild ( textArea ) ;
20
20
} ,
21
21
Original file line number Diff line number Diff line change @@ -142,9 +142,9 @@ const handlers = {
142
142
} ,
143
143
144
144
copyToClipboard ( data ) {
145
- Utils . setTimeout ( TIME_TO_WAIT_FOR_IPC_MESSAGES , function ( ) {
145
+ Utils . setTimeout ( TIME_TO_WAIT_FOR_IPC_MESSAGES , async function ( ) {
146
146
const focusedElement = document . activeElement ;
147
- Clipboard . copy ( data ) ;
147
+ await Clipboard . copy ( data ) ;
148
148
if ( focusedElement != null )
149
149
focusedElement . focus ( ) ;
150
150
window . parent . focus ( ) ;
You can’t perform that action at this time.
0 commit comments