Microsoft Update Catalog - Auto Highlight the version for your OS

Auto Highlight the version for your OS when you download the updates from Microsoft Update Catalog

Autor
𝖢𝖸 𝖥𝗎𝗇𝗀
Instalaciones diarias
0
Instalaciones totales
49
Calificaciones
0 0 0
Versión
0.3
Creado
14/7/2021
Actualizado
18/7/2021
Licencia
Desconocida
Funciona en

Microsoft Update Catalog - Auto Highlight the version for your OS

This user script, named "Microsoft Update Catalog - Auto Highlight the version for your OS," enhances your experience when downloading updates from the Microsoft Update Catalog. It automatically highlights the appropriate version for your operating system (OS) to make it easier for you to identify and select the relevant updates.

How it works

The script is designed to run on web pages within the Microsoft Update Catalog (URL: https://www.catalog.update.microsoft.com/). It utilizes the Tampermonkey browser extension to inject custom JavaScript code into the web page.

Once installed and enabled, the script performs the following actions:

  1. It checks if the web page's DOM (document object model) is ready. If not, it waits for the DOM to be available.

  2. The script defines a function to add custom CSS styles dynamically to the web page. This function creates a new <style> element and appends it to the <head> section of the document, allowing the script to modify the appearance of elements on the page.

  3. It defines another function to determine whether your OS is Intel x64 architecture or not. This function examines the user agent string of your browser and performs pattern matching to identify keywords indicating the OS architecture.

  4. The script includes a JavaScript client detection library to gather information about your browser, such as the browser name, version, major version, whether you are using a mobile device, and other details.

  5. It sets up an interval timer to periodically check for specific elements on the web page. When the target elements are found, the script performs the following steps:

a. Locates the nearest parent <tr> element of the identified element.

b. Finds the corresponding <td> element containing the OS version information.

c. Extracts the OS versions listed in the table cell and checks if your OS version matches any of them.

d. If a match is found, it determines the position of the corresponding <td> element containing the update title.

e. Further checks are performed to see if the update is specific to a particular OS architecture (x86 or x64). If so, it compares the detected architecture from the user agent with the update architecture and skips highlighting if they don't match.

f. If the update is relevant to your OS, it adds a custom attribute to the <tr> element to highlight it visually.

Please note that this script requires the Tampermonkey browser extension to function properly. Once installed, the script will automatically highlight the appropriate OS version for your system when you browse and download updates from the Microsoft Update Catalog.