From 3acdcee1fdfe1b604bb66f64af7cac974e3c6545 Mon Sep 17 00:00:00 2001 From: Javi Agenjo Date: Thu, 26 Oct 2023 20:36:33 +0200 Subject: [PATCH] Update network.js --- src/nodes/network.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/nodes/network.js b/src/nodes/network.js index 9f2f62de1..340016bc4 100755 --- a/src/nodes/network.js +++ b/src/nodes/network.js @@ -365,11 +365,13 @@ //HTTP Request function HTTPRequestNode() { + var that = this; this.addInput("request", LiteGraph.ACTION); this.addInput("url", "string"); - this.addProperty("url", "string"); + this.addProperty("url", ""); this.addOutput("ready", LiteGraph.EVENT); this.addOutput("data", "string"); + this.addWidget("button", "Fetch", null, this.fetch.bind(this)); this._data = null; this._fetching = null; } @@ -379,6 +381,10 @@ HTTPRequestNode.desc = "Fetch data through HTTP"; HTTPRequestNode.prototype.fetch = function() { + var url = this.properties.url; + if(!url) + return; + this.boxcolor = "#FF0"; var that = this; this._fetching = fetch(url)