Last active
December 6, 2022 09:26
-
-
Save chalkygames123/ce3256b034b7aa570fe1f9505756da2e to your computer and use it in GitHub Desktop.
Chatwork: メッセージをすべて既読にする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function () {const settingsButton = document.querySelector('[data-testid="room-header_room-settings-button"]',);const unreadRooms = document.querySelectorAll('#RoomList [role="listitem"]:has(._unreadBadge)',);let currentUnreadRoomIndex = 0;const handleHashChange = () => {settingsButton.click();Array.from(document.querySelector('[role="menu"]').children).find((item) => item.textContent.includes('メッセージをすべて既読にする')).click();if (currentUnreadRoomIndex < unreadRooms.length) {unreadRooms[currentUnreadRoomIndex].click();currentUnreadRoomIndex += 1;} else {window.removeEventListener('hashchange', handleHashChange);}};window.addEventListener('hashchange', handleHashChange);handleHashChange();})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment