-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample-usage.html
More file actions
85 lines (77 loc) · 4.38 KB
/
example-usage.html
File metadata and controls
85 lines (77 loc) · 4.38 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>consoleFilter.js</title>
</head>
<body>
<h1>consoleFilter.js</h1>
<strong>Where is it?</strong>
<p>In the browser's console. This script working with console. Open it by (for example) F12.</p>
<p>For more info:</p>
<ul>
<li>Readme in standalone file <a href="/README.md">/README.md</a></li>
<li>Repo on <a href="https://github.com/iiic/consoleFilter.js">Github</a></li>
<li>Webpage about script <a href="https://iiic.dev/console-filter-js">https://iiic.dev/console-filter-js</a></li>
</ul>
<script type="application/json" id="console-filter-settings">
{
"allowlist": [ "allowedFileName.js", "someFileNotPresented.mjs", "SomeNonPresentedClass" ],
"blocklist": [ "blockedFile.mjs", "blockedAndNonExisting.js", "blockedClass" ]
}
</script>
<script src="/consoleFilter.js" crossorigin="anonymous" integrity="sha256-2yNQV18AToBKEvQVk4oI6l9hS6A/xxM9FEuITt3hUQU="></script>
<script>
const ALLOWED_NAME = 'allowedFileName.js';
const NOT_MENTIONED_NAME = 'NotMentionedClassName';
const BLOCKED_NAME = 'blockedFile.mjs';
const CONSOLE = {
CLASS_NAME: 'color: gray',
METHOD_NAME: 'font-weight: normal; color: green',
INTEREST_PARAMETER: 'font-weight: normal; font-size: x-small; color: blue',
EVENT_TEXT: 'color: orange',
WARNING: 'color: red',
};
</script>
<script>
console.group( BLOCKED_NAME + ' group for script' );
console.log( ALLOWED_NAME ); // without any more text
console.log( ALLOWED_NAME + ' allowed console.log()' );
console.log( NOT_MENTIONED_NAME + ' not-mentioned console.log()' );
console.log( BLOCKED_NAME + ' blocked console.log()' );
console.debug( ALLOWED_NAME + ' allowed console.debug()' );
console.debug( NOT_MENTIONED_NAME + ' not-mentioned console.debug()' );
console.debug( BLOCKED_NAME + ' blocked console.debug()' );
console.log( '%c' + ALLOWED_NAME + '%c allowed console.log() colored', CONSOLE.CLASS_NAME, CONSOLE.METHOD_NAME );
console.log( '%c' + NOT_MENTIONED_NAME + '%c not-mentioned console.log() colored', CONSOLE.CLASS_NAME, CONSOLE.METHOD_NAME );
console.log( '%c' + BLOCKED_NAME + '%c blocked console.log() colored', CONSOLE.CLASS_NAME, CONSOLE.METHOD_NAME );
console.debug( '%c' + ALLOWED_NAME + '%c allowed console.debug() colored', CONSOLE.CLASS_NAME, CONSOLE.METHOD_NAME );
console.debug( '%c' + NOT_MENTIONED_NAME + '%c not-mentioned console.debug() colored', CONSOLE.CLASS_NAME, CONSOLE.METHOD_NAME );
console.debug( '%c' + BLOCKED_NAME + '%c blocked console.debug() colored', CONSOLE.CLASS_NAME, CONSOLE.METHOD_NAME );
console.groupEnd();
console.group( ALLOWED_NAME + ' group with anonymous log() and debug()' );
console.log( 'simple console.log()' );
console.debug( 'simple console.debug()' );
console.groupEnd();
</script>
<script type="module">
console.group( ALLOWED_NAME + ' group for script module' );
console.log( ALLOWED_NAME ); // without any more text
console.log( ALLOWED_NAME + ' allowed console.log() in a module' );
console.log( NOT_MENTIONED_NAME + ' not-mentioned console.log() in a module' );
console.log( BLOCKED_NAME + ' blocked console.log() in a module' );
console.debug( ALLOWED_NAME + ' allowed console.debug() in a module' );
console.debug( NOT_MENTIONED_NAME + ' not-mentioned console.debug() in a module' );
console.debug( BLOCKED_NAME + ' blocked console.debug() in a module' );
console.log( '%c' + ALLOWED_NAME + '%c allowed console.log() in a module, colored', CONSOLE.CLASS_NAME, CONSOLE.METHOD_NAME );
console.log( '%c' + NOT_MENTIONED_NAME + '%c not-mentioned console.log() in a module, colored', CONSOLE.CLASS_NAME, CONSOLE.METHOD_NAME );
console.log( '%c' + BLOCKED_NAME + '%c blocked console.log() in a module, colored', CONSOLE.CLASS_NAME, CONSOLE.METHOD_NAME );
console.debug( '%c' + ALLOWED_NAME + '%c allowed console.debug() in a module, colored', CONSOLE.CLASS_NAME, CONSOLE.METHOD_NAME );
console.debug( '%c' + NOT_MENTIONED_NAME + '%c not-mentioned console.debug() in a module, colored', CONSOLE.CLASS_NAME, CONSOLE.METHOD_NAME );
console.debug( '%c' + BLOCKED_NAME + '%c blocked console.debug() in a module, colored', CONSOLE.CLASS_NAME, CONSOLE.METHOD_NAME );
console.groupEnd();
console.group( ALLOWED_NAME + ' group with anonymous log() and debug() in a module' );
console.log( 'simple console.log() in a module' );
console.debug( 'simple console.debug() in a module' );
console.groupEnd();
</script>