From 3e8604ef4c705a97d8073939aa055663bd394305 Mon Sep 17 00:00:00 2001 From: Jack Nolddor <1280022+nolddor@users.noreply.github.com> Date: Fri, 27 Jun 2025 21:27:57 +0200 Subject: [PATCH 1/5] feat: hide `install steam` for owned games --- scripts/global.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/global.js b/scripts/global.js index 7479c06ec..3679a2f40 100644 --- a/scripts/global.js +++ b/scripts/global.js @@ -25,10 +25,10 @@ else { if( items[ 'enhancement-hide-install-button' ] ) { - /** @type {HTMLElement} */ - const button = document.querySelector( '.header_installsteam_btn' ); + /** @type {NodeListOf} */ + const buttons = document.querySelectorAll( '.header_installsteam_btn, .game_area_already_owned_btn:first-of-type>a' ); - if( button ) + for( const button of buttons ) { button.setAttribute( 'hidden', 'true' ); button.style.display = 'none'; From f4a63a20d536aa997a416e47cd5e40978e334967 Mon Sep 17 00:00:00 2001 From: Jack Nolddor <1280022+nolddor@users.noreply.github.com> Date: Fri, 27 Jun 2025 22:03:37 +0200 Subject: [PATCH 2/5] Revert "feat: hide `install steam` for owned games" This reverts commit 3e8604ef4c705a97d8073939aa055663bd394305. --- scripts/global.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/global.js b/scripts/global.js index 3679a2f40..7479c06ec 100644 --- a/scripts/global.js +++ b/scripts/global.js @@ -25,10 +25,10 @@ else { if( items[ 'enhancement-hide-install-button' ] ) { - /** @type {NodeListOf} */ - const buttons = document.querySelectorAll( '.header_installsteam_btn, .game_area_already_owned_btn:first-of-type>a' ); + /** @type {HTMLElement} */ + const button = document.querySelector( '.header_installsteam_btn' ); - for( const button of buttons ) + if( button ) { button.setAttribute( 'hidden', 'true' ); button.style.display = 'none'; From 7b50cbc997bceff592f8b8bf8e999cae2650a980 Mon Sep 17 00:00:00 2001 From: Jack Nolddor <1280022+nolddor@users.noreply.github.com> Date: Fri, 27 Jun 2025 22:28:18 +0200 Subject: [PATCH 3/5] feat: hide `install steam` for owned games --- scripts/store/app.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/store/app.js b/scripts/store/app.js index e6001f5fd..af666846e 100644 --- a/scripts/store/app.js +++ b/scripts/store/app.js @@ -22,8 +22,25 @@ else 'steamdb-last-update': true, 'enhancement-hide-mobile-app-button': false, 'collapse-already-in-library': false, + 'enhancement-hide-install-button': true, }, ( items ) => { + if( items[ 'enhancement-hide-install-button' ] ) + { + // On app page, `Install Steam` and `Play Now` buttons share the same `.game_area_already_owned_btn` class. + // To distinguish them, we are hiding the first one only if href attribute points to /about/ to avoid + // hiding the `Play Now` button or any other in the event Valve decides to change the order. + + /** @type {HTMLAnchorElement} */ + const button = document.querySelector( '.game_area_already_owned_btn:first-of-type a' ); + + if( button && button.pathname === "/about/" ) + { + button.setAttribute( 'hidden', 'true' ); + button.style.display = 'none'; + } + } + if( ( items[ 'steamdb-last-update' ] || items[ 'online-stats' ] ) && !document.querySelector( '.game_area_dlc_bubble' ) ) { DrawOnlineStatsWidget( items ); From 481341173c5165221f296252f42fc30241309ed7 Mon Sep 17 00:00:00 2001 From: Jack Nolddor <1280022+nolddor@users.noreply.github.com> Date: Fri, 27 Jun 2025 22:35:18 +0200 Subject: [PATCH 4/5] chore: reorder hiding logic after draw logic --- scripts/store/app.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/store/app.js b/scripts/store/app.js index af666846e..d43dc40fb 100644 --- a/scripts/store/app.js +++ b/scripts/store/app.js @@ -25,6 +25,16 @@ else 'enhancement-hide-install-button': true, }, ( items ) => { + if( ( items[ 'steamdb-last-update' ] || items[ 'online-stats' ] ) && !document.querySelector( '.game_area_dlc_bubble' ) ) + { + DrawOnlineStatsWidget( items ); + } + + if( items[ 'steamdb-lowest-price' ] ) + { + DrawLowestPrice(); + } + if( items[ 'enhancement-hide-install-button' ] ) { // On app page, `Install Steam` and `Play Now` buttons share the same `.game_area_already_owned_btn` class. @@ -41,16 +51,6 @@ else } } - if( ( items[ 'steamdb-last-update' ] || items[ 'online-stats' ] ) && !document.querySelector( '.game_area_dlc_bubble' ) ) - { - DrawOnlineStatsWidget( items ); - } - - if( items[ 'steamdb-lowest-price' ] ) - { - DrawLowestPrice(); - } - if( items[ 'enhancement-hide-mobile-app-button' ] ) { /** @type {HTMLMetaElement} */ From ac40741110ca9afafdfa3e458575a72507f5b5bf Mon Sep 17 00:00:00 2001 From: Jack Nolddor <1280022+nolddor@users.noreply.github.com> Date: Sat, 28 Jun 2025 17:42:49 +0200 Subject: [PATCH 5/5] chore: rework option message after feature enhancement --- _locales/en/messages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index da06083a2..29378064d 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -631,7 +631,7 @@ "description": "Steam Subscriber Agreement (SSA): https://store.steampowered.com/subscriber_agreement/" }, "options_enhancement_hide_install_button": { - "message": "Hide \"Install Steam\" button in header", + "message": "Hide \"Install Steam\" button in header and product pages", "description:": "\"Install Steam\" should match what the button on Steam itself in the header says: https://store.steampowered.com/" }, "options_enhancement_hide_mobile_app_button": {