-
Notifications
You must be signed in to change notification settings - Fork 10
/
hide_sidebar_areas.user.js
29 lines (26 loc) · 1.07 KB
/
hide_sidebar_areas.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// ==UserScript==
// @name Hide Sidebar Areas
// @namespace lugburz.hide_sidebar_areas
// @version 0.1
// @description Hide unwanted areas in the sidebar.
// @author Lugburz
// @match https://www.torn.com/*
// @updateURL https://github.com/f2404/torn-userscripts/raw/master/hide_sidebar_areas.user.js
// @grant none
// ==/UserScript==
// Add areas that you want to be hidden here. Both area names (such as "Items") and links (e.g., "competition.php") are supported.
// Example:
// const HIDE = ['Items', 'competitions.php'];
const HIDE = [];
(function() {
'use strict';
// Your code here...
const areas = $('#sidebar').find('div[class^=area-desktop___]');
areas.each(function() {
const name = $(this).find('span[class^=linkName___]').text().trim();
const href = $(this).find('a[class^=desktopLink___]').attr('href').replace('/', '');
if (HIDE.includes(name) || HIDE.includes(name.toLowerCase()) || HIDE.includes(href) || HIDE.includes(href.toLowerCase())) {
$(this).hide();
}
});
})();