Last updated for App Store apps

Add information about when the app was last updated to the product information.

  1. // ==UserScript==
  2. // @name Last updated for App Store apps
  3. // @namespace https://github.com/fnurl/userscripts
  4. // @version 0.1.2
  5. // @description Add information about when the app was last updated to the product information.
  6. // @author @fnurl
  7. // @match https://itunes.apple.com/*
  8. // @license MIT
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. // wait until everything has loaded
  14. $(window).bind("load", function() {
  15. // add an additional wait as workaround for text disappearing when loading for the first time
  16. var timeout = 500;
  17. window.setTimeout(function() {
  18. // Localized labels
  19. var lang = {
  20. "sv": "Senaste",
  21. "en": "Latest",
  22. };
  23. // Localized label string
  24. var updatedText;
  25.  
  26. // Localization for defined presets
  27. var locale = $("html").attr("lang").match("..");
  28. //var locale = window.location.pathname.match("/(.*?)/.*")[1];
  29. if (lang.hasOwnProperty(locale)) {
  30. updatedText = lang[locale];
  31. }
  32. else {
  33. // Localized update history string for other locales
  34. updatedText = $(".version-history__headline").text();
  35. }
  36.  
  37. // Info about the last version
  38. var lastVersion = $(".whats-new__latest").first();
  39. var versionNumber = lastVersion.find('[class$="__latest__version"]').text();
  40. var versionDate = lastVersion.find("time").attr("datetime");
  41.  
  42. // Product info element
  43. var productHeaderList = $("header .product-header__list").first();
  44.  
  45. // Prepare info about last version and add it to the product info
  46. var lastUpdatedListItem = '<li class="product-header__list__item">' +
  47. updatedText + ': ' +
  48. versionNumber + ' (' + versionDate + ')' +
  49. '</li>';
  50. productHeaderList.append(lastUpdatedListItem);
  51. }, timeout);
  52. });
  53. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址