File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 5
5
// @grant none
6
6
// @version 1.0
7
7
// @author -
8
+ // @grant GM_xmlhttpRequest
8
9
// @inject -into content
9
10
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
10
11
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
@@ -591,13 +592,14 @@ function dumpToHcl() {
591
592
nav . append ( hclOutput ) ;
592
593
593
594
// Download the WASM file
594
- fetch ( "https://github.com/mcasperson/OctopusTerraformExport/raw/main/wasm/convert_project.wasm" )
595
- . then ( function ( response ) {
596
- return response . arrayBuffer ( ) ;
597
- } )
598
- . then ( function ( buffer ) {
595
+ GM_xmlhttpRequest ( {
596
+ method : "GET" ,
597
+ url : "https://github.com/mcasperson/OctopusTerraformExport/raw/main/wasm/convert_project.wasm" ,
598
+ responseType : "arraybuffer" ,
599
+ onload : function ( e ) {
600
+ console . log ( e )
599
601
const go = new Go ( ) ;
600
- WebAssembly . instantiate ( buffer , go . importObject )
602
+ WebAssembly . instantiate ( e . response , go . importObject )
601
603
. then ( ( result ) => {
602
604
go . run ( result . instance )
603
605
@@ -641,7 +643,8 @@ function dumpToHcl() {
641
643
. catch ( function ( err ) {
642
644
console . log ( err ) ;
643
645
} )
644
- } ) ;
646
+ }
647
+ } ) ;
645
648
}
646
649
} catch ( err ) {
647
650
console . log ( err ) ;
You can’t perform that action at this time.
0 commit comments