changeset 128:f2a53a2b9a5b

More precise selector
author nanaya <me@nanaya.net>
date Sat, 21 Jan 2023 03:18:24 +0900
parents a701294f38ff
children dc960ef1248b
files twitter-default-following-tab.user.js
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/twitter-default-following-tab.user.js	Sat Jan 21 03:15:26 2023 +0900
+++ b/twitter-default-following-tab.user.js	Sat Jan 21 03:18:24 2023 +0900
@@ -5,7 +5,7 @@
 // @match       https://twitter.com/*
 // @grant       none
 // @run-at      document-start
-// @version     1.1.0
+// @version     1.1.1
 // @author      nanaya
 // @description Always select Following tab on first load
 // @downloadURL https://hg.nanaya.net/ec-userscripts/raw-file/tip/twitter-default-following-tab.user.js
@@ -44,7 +44,7 @@
 
   if (selected) return;
 
-  const followingTab = document.querySelectorAll('[href="/home"][role=tab]')?.[1];
+  const followingTab = document.querySelectorAll('a[href="/home"][role=tab]')?.[1];
   if (followingTab == null) return;
 
   if (followingTab.getAttribute('aria-selected') === 'true') {