Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent save windowPersist when windowState are MINIMIZED, fix #289 #292

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions content/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ if (window.opener) {
}
window.addEventListener("unload", function() {
// save windowState if it's maximized or normal - otherwise use value
var ws = (window.windowState == 1 || window.windowState == 3) ? window.windowState : windowPersist.windowState;
var ws = window.windowState;
// save the other stuff if it's normal state, otherwise use previous
if (ws == 3) {
if (ws === 3) {
// width and height get read from document but set from document.documentElement
// this can fail if this is in a tab. if so, don't save.
try {
Expand All @@ -54,7 +54,9 @@ if (window.opener) {
return;
}
}
windowPersist.windowState = ws;
if (ws === 1 || ws === 3) {
windowPersist.windowState = ws;
}

prefs.setCharPref("editorWindowPersist", JSON.stringify(windowPersist));
});
Expand Down