File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -206,6 +206,7 @@ app.innerHTML = `
206206 </p>
207207 <input type="text" id="urlInput" placeholder="https://gamefaqs.gamespot.com/...">
208208 <button id="btnUrlLoad" type="button">Load</button>
209+ <button id="btnUrlPaste" type="button">Paste</button>
209210 <div id="loadError"></div>
210211 </div>
211212
@@ -1658,6 +1659,15 @@ document.getElementById('btnUrl').addEventListener('click', showUrlLoader);
16581659document . getElementById ( 'btnPasteContinue' ) . addEventListener ( 'click' , loadFromPaste ) ;
16591660document . getElementById ( 'btnUrlLoad' ) . addEventListener ( 'click' , loadFromUrl ) ;
16601661
1662+ document . getElementById ( 'btnUrlPaste' ) . addEventListener ( 'click' , async ( ) => {
1663+ try {
1664+ const text = await navigator . clipboard . readText ( ) ;
1665+ if ( text ) document . getElementById ( 'urlInput' ) . value = text . trim ( ) ;
1666+ } catch ( e ) {
1667+ showToast ( 'Error' , 'Could not access clipboard' ) ;
1668+ }
1669+ } ) ;
1670+
16611671document . getElementById ( 'btnResetTrim' ) . addEventListener ( 'click' , resetTrim ) ;
16621672document . getElementById ( 'btnFind' ) . addEventListener ( 'click' , openFind ) ;
16631673
You can’t perform that action at this time.
0 commit comments