-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfb-nolog.js
More file actions
52 lines (34 loc) · 1.18 KB
/
Copy pathfb-nolog.js
File metadata and controls
52 lines (34 loc) · 1.18 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// ==UserScript==
// @name Facebook No Login
// @description Removes annoying popups and visual cruft when not logged-in
// @namespace https://www.facebook.com
// @icon https://www.facebook.com/favicon.ico
// @include *.facebook.*/*
// @run-at document-start
// @version 1.5.1
// @license CC0; https://creativecommons.org/publicdomain/zero/1.0/
// @homepageURL https://github.com/lidel/userscripts
// @grant GM_addStyle
// ==/UserScript==
// Facebook no-login browser
// Select the div with the aria-label "Close"
var closeDiv = document.querySelector('div[aria-label="Close"]');
// Check if the div exists
if (closeDiv) {
// Simulate a click on the div
closeDiv.click();
// Wait for 1 second (1000 milliseconds)
setTimeout(function() {
// Hide lower banner
// Select the div with the attribute data-nosnippet
var div = document.querySelector('div[data-nosnippet]');
// Check if the div exists
if (div) {
// Set the display property to none
div.style.display = 'none';
}
}, 1000);
} else {
// If the div is not found, log a message or handle the case as needed
console.log('Close button not found.');
}