noxz-sites

A collection of a builder and various scripts creating the noxz.tech sites
git clone https://noxz.tech/git/noxz-sites.git
Log | Files | README | LICENSE

noxz.tech/articles/sites_like_github_com_are_causing_cpu_overload/index.www
1I have disabled JavaScript access to the clipboard in my browser settings and
2have recently experienced frustration with the behavior of github.com in
3continually checking for clipboard support. I have discovered that github.com
4erroneously checks for clipboard support by checking the
5.ICD navigator.clipboard.read
6function,
7without taking into account whether the
8.ICD navigator.clipboard
9object is undefined, which can lead to an infinite loop that spikes CPU usage.
10
11I have found a temporary workaround by defining and injecting the
12.ICD navigator.clipboard
13object myself, creating a dummy object with the read and write functions set
14to zero (or some arbitrary non-function value). This solution effectively stops
15the infinite loop from occurring and tricks the website into thinking that
16clipboard support is disabled.
17
18.CDS
19.COS
20(function() {
21/* fix: when sites ask for a clipboard such as github.com
22 * in navigator-clipboard.js causing CPU-overload! */
23navigator.clipboard = {
24	read  : 0,
25	write : 0,
26};
27}());
28.COE
29.CDE
30
31It's important to note that other users who have not disabled clipboard access
32in their browser settings may not have experienced this issue. However, the
33solution provided may still be helpful for those who have disabled clipboard
34access and are experiencing similar issues with github.com's clipboard support
35check.