Closed TorstenDittmann closed 4 years ago
What OS/web engine did you use?
It occurs on Windows with both EdgeHTML and Trident. On Webkit everything works fine. You can reproduce it by just adding a window.location.reload()
to the API Demo :+1:
@TorstenDittmann Hi,
After some googling it turns out this issue has been studied for a long time since the dark age of IE. There are some workaround but never perfect. I think I'll just leave this issue unsolved.
Inconsistencies about navigations happen a lot among different platforms. For cross-platform consistency I would avoid usages of navigation-related functions and events (except ready-to-show and first-time loadURL/loadFile), especially those in BOM.
Alright. I fully understand you.
For people with the same problem I am gonna edit this post later and add some examples on how to handle this problem.
Gonna close it later.
Edit: Add a messageNode to your DeskGap main js file:
// index.js
const {
app,
BrowserWindow,
messageNode
} = require('deskgap');
app.once('ready', () => {
// Add MessageNode for reloading with BrowserWindow
messageNode.on("reload", () => {
win.reload();
});
const win = new BrowserWindow();
win.loadFile('index.html');
});
For any time you want to reload your page you can use a reload()
method like this:
// Inside App Code
const { messageUI } = window.deskgap || {};
function reload() {
return window.deskgap ? messageUI.send('reload') : window.location.reload();
};
Using
window.location.reload()
in code removes thewindow.deskgap
reference and all of the drag functionality from elements with thedata-deskgap-drag
attribute.Reloading with
BrowserWindow
works fine.