|
1 | 1 | // ==UserScript== |
2 | | -// @name linkedin |
3 | | -// @version 16 |
4 | | -// @match https://www.linkedin.com/* |
5 | | -// @updateURL https://www.ezramarks.com/personal-app-tweaks/linkedin.user.js |
6 | | -// @downloadURL https://www.ezramarks.com/personal-app-tweaks/linkedin.user.js |
7 | | -// @run-at document-start |
| 2 | +// @name linkedin |
| 3 | +// @version 17 |
8 | 4 | // ==/UserScript== |
9 | 5 | (function() { |
10 | 6 |
|
11 | 7 | const CSS = ` |
12 | | - html { zoom: 2.0; } |
13 | | -
|
14 | 8 | /* Nav: hide everything except Search and Messaging. |
15 | | - Use path fragment without trailing slash — profile pages use absolute URLs |
16 | | - (e.g. https://www.linkedin.com/mynetwork) while messaging uses relative (/mynetwork/). */ |
| 9 | + Path fragment without trailing slash — profile pages use absolute URLs. */ |
17 | 10 | a[href*="/feed"], |
18 | 11 | a[href*="/mynetwork"], |
19 | 12 | a[href*="/jobs"], |
|
22 | 15 | display: none !important; |
23 | 16 | } |
24 | 17 |
|
25 | | - /* Feed page: hide content. These selectors are feed-specific (verified absent on search). */ |
| 18 | + /* Feed page: hide content (feed-specific, verified absent on search/profiles). */ |
26 | 19 | [data-testid="mainFeed"], |
27 | 20 | [aria-label*="start a post" i] { |
28 | 21 | display: none !important; |
|
32 | 25 | [data-ad-banner] { |
33 | 26 | display: none !important; |
34 | 27 | } |
35 | | -
|
36 | 28 | `; |
37 | 29 |
|
38 | 30 | const style = document.createElement('style'); |
|
46 | 38 | } |
47 | 39 | }); |
48 | 40 |
|
49 | | - // Redirect away from disallowed pages — makes feed/network/jobs unreachable |
| 41 | + // Redirect away from disallowed pages |
50 | 42 | const ALLOWED = [ |
51 | 43 | /^\/messaging(\/|$)/, |
52 | 44 | /^\/search\//, |
|
59 | 51 |
|
60 | 52 | function enforce() { |
61 | 53 | var p = location.pathname; |
62 | | - // Redirect /search/results/all to people — no stable CSS selector to hide just the Posts section |
| 54 | + // Redirect /search/results/all to people — no stable CSS selector to hide just Posts |
63 | 55 | if (p.startsWith('/search/results/all')) { |
64 | 56 | location.replace(location.href.replace('/search/results/all', '/search/results/people')); |
65 | 57 | return; |
|
0 commit comments