├── LICENSE
├── README.md
├── unity-forum-fixer.js
└── unity-old-post-wayback.js
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 mika
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # UnityForumFixer
2 | Firefox [GreaseMonkey](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/)-plugin to improve Unity forums.
3 | Supports both Light & Dark themes!
4 |
5 | ### Forum link
6 | - https://discussions.unity.com/t/browser-greasemonkey-script-to-fix-improve-new-forums-ui-ux/1507183
7 |
8 | ### Fixes
9 | - Add Asset Store link at the top
10 | - hide welcome banner
11 | - remove search bar padding
12 | - hide big bg image
13 | - remove ALL rounded edges, note user icons are now boxes too - might change it later
14 | - hide views icon
15 | - hide replies icon
16 | - hide cookie button from premium location
17 | - move search dropdown, so that it doesnt block search bar bottom
18 | - recent searches font size
19 | - recent searches hover color to something reasonable
20 | - display proper activity times in minutes, not meters : D ("1m" is now "1 minute ago")
21 | - move "resolved" label to right of post title
22 | - hide "unresolved" (since most topics are really unresolved..unless marked solved?)
23 | - hide category icon (most of them seemed to be just unity logo.. might adjust later)
24 | - adjust post title font & size
25 | - add hover color and underline to post titles
26 | - post topic rows, half the padding
27 | - tags below post titles smaller font
28 | - post activity smaller font
29 | - hide "... or filter the topics via"
30 | - navbar smaller padding
31 | - areas, categories tags width to auto
32 | - move new topic button right
33 | - new topic drowdown description texts with different color and font size, easier to read compared to title & description in same color)
34 | - searchbar to 100% width (still need to adjust later for better location)
35 | - sidebar topic headers to slightly left (instead of same intendation with items)
36 | - sidebar row heights smaller
37 | - sidebar icons smaller
38 | - show original poster name and topic creation date
39 | - show last activity username
40 | - post view: show username above user icon (instead of separately in the message area)
41 | - post view: add gray bg for user icon area
42 | - smaller new topics alert panel
43 | - hide suggested topics at bottom
44 | - make unity footer smaller and centered
45 | - latest posts view: make main area less wide
46 | - hot topics: disable orange color for view/reply counts
47 | - Combine Views and Replies into one field
48 | - Optional: Hide all "question" tags
49 | - post view: Display registration date for OP and few other users *Note: requires JSON fetch, you can disable it by removing PostViewFetchOPDetails() call inside update.
50 | - and much more!
51 |
52 | ### TODO
53 | - Main list here https://github.com/unitycoder/UnityForumFixer/issues/1
54 |
55 | ### Before
56 | 
57 |
58 | ### After *current WIP
59 | 
60 |
61 |
62 | ### Related repos (to improve Unity dev user experience)
63 | - Unity Hub Improvements https://github.com/unitycoder/UnityHubModding
64 | - Unity Launcher Pro https://github.com/unitycoder/UnityLauncherPro
65 |
--------------------------------------------------------------------------------
/unity-forum-fixer.js:
--------------------------------------------------------------------------------
1 | // ==UserScript==
2 | // @name UnityForumFixer
3 | // @namespace https://unitycoder.com/
4 | // @version 0.87 (26.05.2025)
5 | // @description Fixes For Unity Forums - https://github.com/unitycoder/UnityForumFixer
6 | // @author unitycoder.com
7 | // @match https://discussions.unity.com/latest
8 | // @match https://discussions.unity.com/t/*
9 | // ==/UserScript==
10 |
11 |
12 | (function() {
13 | 'use strict';
14 |
15 | // Run the script after the DOM is fully loaded
16 | window.addEventListener('DOMContentLoaded', function()
17 | {
18 |
19 | AppendCustomCSS();
20 | AddAssetStoreLink();
21 | NavBar();
22 | TopicsViewShowOriginalPosterInfo(); // TODO needs some css adjustments for name location
23 | FixPostActivityTime();
24 | PostViewShowOriginalPosterInfo();
25 | TopicsViewCombineViewAndReplyCounts();
26 | OnMouseOverPostPreview();
27 | AddOnHoverOpenNotificationPanel();
28 |
29 |
30 | // update notification panel icons
31 | const currentUserButton = document.getElementById('toggle-current-user');
32 | if (currentUserButton) {
33 | currentUserButton.addEventListener('click', () => {
34 | // Add a slight delay to ensure the dropdown content is fully rendered
35 | setTimeout(replaceNotificationIcons, 1000);
36 | });
37 | } else {
38 | console.warn('Current user button not found.');
39 | }
40 |
41 |
42 | setTimeout(OnUpdate, 1000); // run loop to update certain itesm (since something is updating them, without page refresh..)
43 | });
44 |
45 |
46 | })();
47 |
48 | // runs every second to update things (if you scroll the page, need to update new data)
49 | // TODO could be better to catch page change/update some other way (xhrevent, mutation..), since it doesnt update now if click some item (like open post)
50 | function OnUpdate()
51 | {
52 | FixPostActivityTime();
53 | TopicsViewShowOriginalPosterInfo();
54 | PostViewShowOriginalPosterInfo();
55 | PostViewFetchOPDetails();
56 |
57 | // TODO only refresh these when notification panel is opened
58 | //replaceNotificationIcons();
59 |
60 | setTimeout(OnUpdate, 1000);
61 | }
62 |
63 |
64 |
65 | function AppendCustomCSS()
66 | {
67 |
68 | var style = document.createElement('style');
69 | style.textContent =
70 | `
71 | /* top banner */
72 | .before-header-panel-outlet { text-align: center; }
73 | .show-more.has-topics { width: 35% !important; }
74 | /* latest posts view */
75 | .show-more.has-topics { width: 35%;!important;}
76 | .alert.alert-info.clickable {width: 35%; padding:3px !important;}
77 |
78 | #main-outlet {width:auto !important;} /* smaller main forum width */
79 |
80 | /* replies/views: heatmap colors */
81 | html .heatmap-med,html .heatmap-med a,html .heatmap-med .d-icon,html .heatmap-med {color: inherit !important;}
82 | html .heatmap-high,html .heatmap-high a,html .heatmap-high .d-icon,html .heatmap-high {color: inherit !important; font-weight:inherit !important;}
83 |
84 | /* post titles */
85 | .title.raw-link.raw-topic-link:link {font: bold 11pt 'Inter', sans-serif;}
86 | .title.raw-link.raw-topic-link:hover {color: rgb(82,132,189) !important; text-decoration: underline !important;}
87 | body .main-link .title.raw-link.raw-topic-link:visited { font:normal !important; color: var(--primary) !important}
88 |
89 | .wrap.custom-search-banner-wrap h1 {display: none;} /* hide welcome banner */
90 | .wrap.custom-search-banner-wrap {padding:0px;} /* remove search bar padding */
91 | :root {--d-background-image: none !important;} /* hide big bg image */
92 | * { border-radius: 0 !important; } /* remove ALL rounded edges, note user icons are now boxes too - might change it later */
93 | .fa.d-icon.d-icon-far-eye.svg-icon.svg-string {display: none !important;} /* hide views icon */
94 | .fa.d-icon.d-icon-comments.svg-icon.svg-string {display: none !important;} /* hide replies icon */
95 | .btn.no-text.btn-icon.cookie-settings.btn-flat.onetrust-cookie-settings-toggle {display: none !important;} /* hide cookie button from premium location */
96 | .results {margin-top:1px; } /* move search dropdown, so that it doesnt block search bar bottom */
97 | .search-menu-recent {font-size:0.8em !important;} /* recent searches font size */
98 | .search-menu .search-link:hover,.search-menu .search-link:focus,.search-menu-container.search-link:hover,.search-menu-container.search-link:focus {background-color: #5693b0 !important} /* recent searches hover color to something reasonable */
99 | .is-solved-label.solved {font-weight: normal !important; font-size: 12px !important; padding: 1px !important; user-select: text !important; float: right !important; } /* resolved tag, initial fixes */
100 | .badge-category__icon {display: none !important;} /* hide badge category icon for now, since most of them seem to be unity logos */
101 | .is-solved-label {display: none !important;} /* hide unresolved span, since all are unresolved, unless marked solved? */
102 | .topic-list .topic-list-data:first-of-type {padding-left: 8px !important;} /* post topic rows, half the padding */
103 | .discourse-tags {font-size: 0.8em !important;} /* tags below post title, smaller */
104 | .discourse-tag.simple {border: 1px solid rgba(var(--primary-rgb), 0.05) !important;}
105 |
106 | /* if want to hide all question tags */
107 | /* a[data-tag-name="question"] { display: none !important; }*/
108 |
109 | .relative-date {font-size: 0.9em !important; color: rgb(150, 150, 150) !important;}
110 | .ember-view.bread-crumbs-left-outlet.breadcrumb-label {display: none !important;} /* "… or filter the topics via" */
111 | .navigation-container {--nav-space: 0 !important; padding-bottom: 6px;} /* navbar adjustments */
112 | .category-breadcrumb.ember-view {width:auto !important;} /* areas,categories,tags not 100% width */
113 | .navigation-controls { display: flex; justify-content: flex-end; width: 100%; } /* move new topic button to right, still would be nice to have in same row as other nav */
114 | .select-kit-row .desc { font-size: 0.92em !important; margin-top:1px; color: #777777 !important; } /* new topic dropdown descriptions */
115 |
116 | .custom-search-banner-wrap > div {max-width:100% !important;} /* search bar maxwidth, need to find better location later */
117 | .sidebar-wrapper {font-size: 0.99em !important;} /* sidebar */
118 | .sidebar-section-header-wrapper.sidebar-row {padding:4px !important;} /* sidebar headers bit to the left */
119 | .ember-view.sidebar-section-link.sidebar-row {height:25px !important;} /* sidebar row heights */
120 | .sidebar-section-link-prefix .svg-icon {height: 12px !important; width: 12px !important;} /* sidebar icons smaller */
121 |
122 | /* post view, username */
123 | .user-name { margin-bottom: 5px; font-weight: bold; text-align: center; font-size: 0.9em; color: var(--primary); text-decoration: none; display: block; word-wrap: break-word; white-space: normal; width: 100%; }
124 | .user-name:hover { color: rgb(82,132,189); text-decoration: underline; }
125 | .names.trigger-user-card {visibility: hidden !important;}
126 | /* .row { display: flex; } */
127 | .topic-avatar { flex-basis: 10%; margin:0 !important; max-width: 45px;}
128 | .topic-body { flex-basis: 90%; } /* Ensure the main content adjusts accordingly */
129 | .topic-avatar {background-color: #d1d1d132;}
130 | .post-avatar { display: flex; flex-direction: column; align-items: center; }
131 | /*.avatar { margin: 4px; } bug in topic view*/
132 | .topic-body {padding: 0 !important;}
133 | .topic-map.--op {display: none !important;} /* hide view count under op post, could move it somewhere else later */
134 | .container.posts {gap:unset !important;} /* post view thinner */
135 |
136 | .user-signature {max-height:32px; overflow:hidden;padding: 8px 8px 4px 24px !important;} /* max size for signature */
137 | .avatar-flair {top:55px; right: -2px; bottom:unset !important;}
138 |
139 |
140 | .more-topics__container {display:none !important;} /* hide suggested topics at bottom */
141 | /* unity footer & content - could hide it.. but then unity is sad*/
142 | .unity-footer {font-size:0.7em !important; line-height: none !important; padding:0 !important; text-align:center !important;}
143 | .footer.unity-footer .unity-footer-content {padding-left:10px !important; line-height: 12px !important;}
144 | .unity-footer-content { display: flex; flex-direction: column; align-items: center; text-align: center; }
145 | .unity-footer-menu.unity-footer-menu-legal.processed { list-style: none; padding: 0; margin: 0; display: flex; justify-content: center; }
146 | .unity-footer-menu.unity-footer-menu-legal.processed li { margin: 0 10px; }
147 |
148 |
149 | /* added custom fields */
150 | .original-poster-span {font: 13px 'Inter', sans-serif !important; color: rgb(150, 150, 150); } /* original poster below post title */
151 | .latest-poster-span { display: block; word-break: break-all; max-width: 100%; font: 14px 'Inter', sans-serif !important;} /* activity, latest poster */
152 |
153 | .combined-replies-container {display: flex;justify-content: space-between;width: 100%;white-space: nowrap; font-size:14px; margin-bottom:2px;}
154 | .combined-views-container {display: flex;justify-content: space-between;width: 100%;white-space: nowrap; font-size:13px;}
155 |
156 | .combined-replies-label {color: rgb(150, 150, 150); text-align: left;}
157 | .combined-replies-number {color: var(--primary); margin-left: auto;text-align: right; font-size:15px !important;}
158 | .combined-views-label {color: rgb(150, 150, 150); text-align: left;}
159 | .combined-views-number {color: rgb(150, 150, 150); margin-left: auto;text-align: right;}
160 |
161 | .custom-post-username {margin-bottom:3px;color: var(--primary);}
162 | .custom-user-creation-date {width:45px;margin-top:6px;font: 13px 'Inter', sans-serif !important; color: rgb(150, 150, 150);}
163 | .custom-post-preview { position: absolute; max-width: 450px; max-height: 200px; background-color: var(--primary-low); border: 1px solid black; padding: 5px; border-radius: 5px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); z-index: 1000; }
164 |
165 | code.lang-auto, code.language-csharp { font-family: 'Fira Code', monospace; }
166 | .select-kit .select-kit-row {padding: 0px 0px 0px 6px !important;} /* project area dropdown */
167 |
168 | /* notification dismiss button */
169 | .quick-access-panel .panel-body-bottom {position:absolute;top:0;left:0;right:0;margin:8px 0;display:flex;justify-content:flex-end;padding:0 8px;background:transparent;border:none;box-shadow:none;}
170 | .quick-access-panel .btn.no-text.btn-default.show-all { height:20px; }
171 | .quick-access-panel .notifications-dismiss {font-size:0.8em;padding:4px 8px;height:20px; min-width:50%;}
172 | .panel-body-contents {margin-top:40px !important;}
173 |
174 | img.avatar[title] { pointer-events: none; }
175 |
176 | `;
177 | document.head.appendChild(style);
178 | }
179 |
180 | // HEADER
181 |
182 | function AddAssetStoreLink()
183 | {
184 | // Create the new list item
185 | var newListItem = document.createElement('li');
186 | var newLink = document.createElement('a');
187 | newLink.href = 'https://assetstore.unity.com/';
188 | newLink.className = '';
189 | newLink.textContent = 'Asset Store';
190 | newLink.target = '_blank';
191 |
192 | // Append the link to the new list item
193 | newListItem.appendChild(newLink);
194 |
195 | // Find the correct