Skip to content

Commit 3acdcee

Browse files
authored
Update network.js
1 parent 2bc9fd9 commit 3acdcee

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/nodes/network.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,11 +365,13 @@
365365

366366
//HTTP Request
367367
function HTTPRequestNode() {
368+
var that = this;
368369
this.addInput("request", LiteGraph.ACTION);
369370
this.addInput("url", "string");
370-
this.addProperty("url", "string");
371+
this.addProperty("url", "");
371372
this.addOutput("ready", LiteGraph.EVENT);
372373
this.addOutput("data", "string");
374+
this.addWidget("button", "Fetch", null, this.fetch.bind(this));
373375
this._data = null;
374376
this._fetching = null;
375377
}
@@ -379,6 +381,10 @@ HTTPRequestNode.desc = "Fetch data through HTTP";
379381

380382
HTTPRequestNode.prototype.fetch = function()
381383
{
384+
var url = this.properties.url;
385+
if(!url)
386+
return;
387+
382388
this.boxcolor = "#FF0";
383389
var that = this;
384390
this._fetching = fetch(url)

0 commit comments

Comments
 (0)