在 node-red 中替代 history.replaceState

alternative to history.replaceState in node-red

我目前正在使用 Node-RED 开发应用程序。我想更改 URL 而不重定向到另一个域。我对基本 JavaScript 有一些经验,我知道在 JS 中可以使用 history.replaceState() 来实现这一点。但是 history 对象在 Node-RED 中不可用。如果我尝试在我的流程或我自己的节点之一中使用 .replaceState(),它将输出一个引用错误 (ReferenceError: history is not defined)。

我读到 global 类似于 JS window 对象,但我想这在这种情况下对我没有帮助,是吗?在 Node-RED 中是否有替代 history.replaceState() 的方法?

函数节点中的任何代码 运行 在 Node-RED 的服务器端 运行 不在编辑器中,您不能 mask/change 的 URL来自 with in a flow 的编辑器。