# Description
The "Twitter Favicon" userscript was created to address a change implemented by Twitter on July 24, 2023. On this date, the social media platform's traditional blue bird favicon was replaced by a new logo, a stylized white "X" on a black background, to signify the company's renaming to "X" and its new focus on becoming an "everything app". This change was announced by Elon Musk, the company's CEO, on July 23, 2023.
This script serves to restore the original Twitter favicon on the user's browser, effectively replacing the "ugly X" favicon with the familiar blue bird icon. This is particularly useful for users who prefer the old favicon or who wish to personalize their browsing experience.
# Instructions
## Installation
1. Install the Tampermonkey extension on your browser. Tampermonkey is a free browser extension and the most popular userscript manager. It's available for Chrome, Microsoft Edge, Safari, Opera Next, and Firefox.
2. Click on the Tampermonkey icon in your browser toolbar and select "Create a new script".
3. Copy the provided script and paste it into the Tampermonkey editor.
4. Save the script. Now, the script will run whenever you visit the Twitter/X website.
## Customization
To restore the original Twitter favicon, you'll need to change the URL in the `link.href` line of the script. Replace `'https://abs.twimg.com/favicons/twitter.2.ico'` with the URL of the original Twitter favicon. If you prefer to use a different favicon, replace the URL with the link of your preferred favicon instead.
## How It Works
The script functions by waiting for the webpage to fully load. Once the webpage has loaded, it searches for an existing favicon link in the webpage's `` section. If a favicon link is found, the script changes the href attribute of that link to the URL of the old Twitter favicon. If no favicon link is found, the script creates a new link with the appropriate rel, type, and href attributes, and appends this link to the webpage's `` section.
# Additional Information
This script runs on the client side, which means it only changes the favicon on your local machine. Other users visiting the same website will not see the old favicon unless they also have a similar userscript installed and enabled. The script is compatible with Tampermonkey, a popular userscript manager. It's set to run on pages that match the pattern "https://twitter.com/*", which includes the main Twitter/X page as well as any Twitter/X subpages. The script does not require any special privileges to run, as indicated by the '@grant none' metadata.