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

"Please update XKit!" notification code is unused #2171

Open
marcustyphoon opened this issue Dec 2, 2024 · 0 comments
Open

"Please update XKit!" notification code is unused #2171

marcustyphoon opened this issue Dec 2, 2024 · 0 comments

Comments

@marcustyphoon
Copy link

It might appear from this piece of code's existence that New XKit notifies users when a new extension version is available. (I was looking into this to potentially delay it by, oh, 24 hours, so that in most cases users with automatic updates on would not see it frequently if we push updates).

It appears, though, that this piece of code is not called. (Also, I'm pretty sure it would be broken in certain cases if it was called, as per its "This is awful but at least it works" comment; it should be updated to have equivalent comparison logic to the shouldUpdate function in XKit Updates if we enable it. 7.11.0 is currently parsed as older than 7.10.10, if I understand correctly.)

Per git bisect, it appears to have been disabled in #1548 and the comment vanished in #1775.

This is more a "document the situation" issue than a "we should fix this" issue.

XKit.download.page("framework_version.php", function(mdata) {
if (mdata.server_down === true) {
XKit.window.show("Can't connect to server",
"XKit was unable to contact the servers in order to download framework version update file. " +
'You might be using an outdated or buggy version of XKit. ' +
'Please visit <a href="http://new-xkit-extension.tumblr.com">the unofficial XKit Blog</a> for updates and details.',
"error", '<div id="xkit-close-message" class="xkit-button default">OK</div>');
return;
}
// This is awful but at least it works.
var my_version = parseFloat(XKit.tools.replace_all(XKit.version, "\\.", ""));
var mb_object;
var new_version;
if (XKit.browser().firefox === true &&
typeof XKit.extensions.xkit_preferences.news.return_browser_from_framework_data("firefox", mdata) !== "undefined") {
mb_object = XKit.extensions.xkit_preferences.news.return_browser_from_framework_data("firefox", mdata);
}
if (XKit.browser().safari === true &&
typeof XKit.extensions.xkit_preferences.news.return_browser_from_framework_data("safari", mdata) !== "undefined") {
mb_object = XKit.extensions.xkit_preferences.news.return_browser_from_framework_data("safari", mdata);
}
new_version = parseFloat(XKit.tools.replace_all(mb_object.version, "\\.", ""));
if (new_version > my_version) {
XKit.notifications.add("<b>Please update XKit!</b><br/>A new version of XKit is available for your browser. " +
"Please click here for more information and how you can easily and quickly update now.", "warning", true, function() {
XKit.window.show("Please update XKit",
"<b>A new version of XKit, version " + mb_object.version + " is available.</b><br/>" +
"You are currently using XKit version " + XKit.version + ".<br/><br/>" +
"Please update to the latest version as soon as possible. If you don't, XKit might not work properly, " +
"or might not work at all in the future.<br/><br/>All you have to do is to go to the XKit download page, " +
"and re-download XKit. XKit will update itself, and all your settings will be preserved.",
"warning",
'<a class="xkit-button default" href="https://new-xkit-extension.tumblr.com/downloads">Go to Download page</a>' +
'<div class="xkit-button" id="xkit-close-message">Not now, remind me later.</div>');
});
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant