nwjs - 在 Mac 上使用 nwjs 硬刷新浏览器
问题描述
在 Mac 上运行带有 nwjs 的应用程序时,有没有办法进行硬浏览器刷新?nwjs 的右键单击“模拟浏览器重启”似乎再次在其入口点启动应用程序。有没有办法模拟在 Chrome 中单击 shift reload 按钮的行为?
解决方案
为此有一个 nwjs api:
// Load native UI library
var ngui = require('nw.gui');
// Get the current window
var nwin = ngui.Window.get();
// this will do a hard refresh
nwin.reloadIgnoringCache();
// here's a regular refresh
nwin.reload();
nwjs 文档:
http://docs.nwjs.io/en/latest/References/Window/#winreloadignoringcache
推荐阅读
- sql - 在 SQL 查询中使用带有 ON 子句的 Case 语句
- python - 如何使用 PyDictionary 获得一个单词的含义?
- rust - 模仿 CraftingInterpeter 的 BINARY_OP 宏
- node.js - 如何解决 TypeError:上传到 minio 时元数据应为“对象”类型
- python - 如何在不使用列表推导的情况下创建一个在给定字符串值列表中反转字符串的函数
- c# - 反序列化时如何在.net核心API FromBody参数中自动将数字转换为字符串?
- javascript - javascript中嵌套数组的最佳实践
- python - 这些 `.` 属性绑定在 `functools.partial` 的实现中是必需的吗?
- ruby - 如何编写具有多种可能结果的场景
- azure - Azure Function 无法加载 ApplicationInsights 程序集