Project

General

Profile

Download (2.57 KB) Statistics
| Branch: | Revision:

hydrilla-fixes-bundle / src / lifewire-com-fix / lifewire.js @ f938b039

1
/**
2
 * SPDX-License-Identifier: LicenseRef-GPL-3.0-or-later-WITH-js-exceptions
3
 *
4
 * Remove a grey banner from Lifewire pages and allow dismissing the cookie
5
 * notice.
6
 *
7
 * Copyright (C) 2022 Jacob K
8
 * Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
9
 *
10
 * This program is free software: you can redistribute it and/or modify
11
 * it under the terms of the GNU General Public License as published by
12
 * the Free Software Foundation, either version 3 of the License, or
13
 * (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU General Public License for more details.
19
 *
20
 * As additional permission under GNU GPL version 3 section 7, you
21
 * may distribute forms of that code without the copy of the GNU
22
 * GPL normally required by section 4, provided you include this
23
 * license notice and, in case of non-source distribution, a URL
24
 * through which recipients can access the Corresponding Source.
25
 * If you modify file(s) with this exception, you may extend this
26
 * exception to your version of the file(s), but you are not
27
 * obligated to do so. If you do not wish to do so, delete this
28
 * exception statement from your version.
29
 *
30
 * As a special exception to the GPL, any HTML file which merely
31
 * makes function calls to this code, and for that purpose
32
 * includes it by reference shall be deemed a separate work for
33
 * copyright law purposes. If you modify this code, you may extend
34
 * this exception to your version of the code, but you are not
35
 * obligated to do so. If you do not wish to do so, delete this
36
 * exception statement from your version.
37
 *
38
 * You should have received a copy of the GNU General Public License
39
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
40
 *
41
 *
42
 * I, Wojtek Kosior, thereby promise not to sue for violation of this file's
43
 * license. Although I request that you do not make use of this code in a
44
 * proprietary program, I am not going to enforce this in court.
45
 */
46

    
47
/* Use with: https://www.lifewire.com/*** */
48

    
49
/* Just get rid of a grey rectangle that partially covers the page. */
50
if (document.getElementById("mntl-leaderboard-header_1-0"))
51
    document.getElementById("mntl-leaderboard-header_1-0").remove();
52

    
53
/* Make cookie notice dismissable. */
54
for (const banner of document.querySelectorAll("#onetrust-consent-sdk")) {
55
  for (const close_button of banner.querySelectorAll(".banner-close-button"))
56
    close_button.addEventListener("click", () => banner.remove());
57
}
(2-2/2)