GameBoy-Online icon indicating copy to clipboard operation
GameBoy-Online copied to clipboard

open link.

Open pavelbv2 opened this issue 5 years ago • 3 comments

Hello.

How can I open ROM via a link from a site, rather than opening it from a computer. Maybe somewhere here you can fix it - if (typeof this.files != "undefined") { try { if (this.files.length >= 1) { cout("Reading the local file \"" + this.files[0].name + "\"", 0); try { //Gecko 1.9.2+ (Standard Method) var binaryHandle = new FileReader(); binaryHandle.onload = function () { if (this.readyState == 2) { cout("file loaded.", 0); try { initPlayer(); start(mainCanvas, this.result); } catch (error) { alert(error.message + " file: " + error.fileName + " line: " + error.lineNumber); } } else { cout("loading file, please wait...", 0); } } binaryHandle.readAsBinaryString(this.files[this.files.length - 1]); }

pavelbv2 avatar Oct 04 '19 17:10 pavelbv2

Hello.

How can I open ROM via a link from a site, rather than opening it from a computer.

Maybe somewhere here you can fix it -

` if (typeof this.files != "undefined") {

  	try {

  		if (this.files.length >= 1) {

  			cout("Reading the local file \"" + this.files[0].name + "\"", 0);

  			try {

  				//Gecko 1.9.2+ (Standard Method)

  				var binaryHandle = new FileReader();

  				binaryHandle.onload = function () {

  					if (this.readyState == 2) {

  						cout("file loaded.", 0);

  						try {

  							initPlayer();

  							start(mainCanvas, this.result);

  						}

  						catch (error) {

  							alert(error.message + " file: " + error.fileName + " line: " + error.lineNumber);

  						}

  					}

  					else {

  						cout("loading file, please wait...", 0);

  					}

  				}

  				binaryHandle.readAsBinaryString(this.files[this.files.length - 1]);

  			}`

ahmedsaee468 avatar Jan 10 '22 19:01 ahmedsaee468

Uh anyone figure this out yet

Darklife12354 avatar Apr 27 '23 01:04 Darklife12354

@ahmedsaee468

var romLink = "https://example.com/path/to/romfile.rom";

var link = document.createElement("a");
link.style.display = "none";
link.href = romLink;

// add the link to the body of the document
document.body.appendChild(link);

// here you simulate a click event that would prompt the download
link.click();

// to remove the link from the document body
document.body.removeChild(link);

this can only be achievable if you have the ROM file link already

dominicOT avatar Jun 10 '23 10:06 dominicOT