Repository: darkreader/darkreader
Pull request #6587 (2021-08-23 03:11:59)

update dark-sites.config to incluide bitcoinity.org/markets


Patch:
diff --git a/src/config/dark-sites.config b/src/config/dark-sites.config
index f88cc412..49f8376e 100644
--- a/src/config/dark-sites.config
+++ b/src/config/dark-sites.config
@@ -84,6 +84,7 @@ bin.disroot.org
 binclub.dev
 bing.com/$
 bip.staszic.waw.pl
+bitcoinity.org/markets
 bitcoinwisdom.com
 bittube.video
 blackhat.com
diff --git a/src/config/dynamic-theme-fixes.config b/src/config/dynamic-theme-fixes.config
index 23d0f580..4cfb945e 100644
--- a/src/config/dynamic-theme-fixes.config
+++ b/src/config/dynamic-theme-fixes.config
@@ -4780,6 +4780,13 @@ header.ant-layout-header img
 
 ================================
 
+fio.fnar.net
+
+INVERT
+.chartjs-render-monitor
+
+================================
+
 firebase.google.com
 
 INVERT
@@ -7192,6 +7199,14 @@ img.mwe-math-fallback-image-inline
 
 ================================
 
+latimes.com
+
+INVERT
+.page-logo
+.page-header-logo
+
+================================
+
 launchpad.net
 
 INVERT
@@ -8670,6 +8685,13 @@ INVERT
 
 ================================
 
+musclewiki.com
+
+INVERT
+img[src="/static/images/logo.png"]
+
+================================
+
 music.163.com
 
 INVERT
@@ -8956,6 +8978,14 @@ INVERT
 
 ================================
 
+news.yahoo.com
+
+INVERT
+#uh-logo
+.vp-handle
+
+================================
+
 news.ycombinator.com
 
 INVERT
@@ -10178,6 +10208,13 @@ IGNORE IMAGE ANALYSIS
 
 ================================
 
+rationalwiki.org
+
+INVERT
+.mw-wiki-logo
+
+================================
+
 realmicentral.com
 
 INVERT
@@ -12639,6 +12676,12 @@ twitch.tv
 
 INVERT
 .volume-slider__slider-container
+.seekbar-bar
+
+CSS
+.seekbar-segment {
+    background-color: rgb(169, 112, 255) !important;
+}
 
 ================================
 
diff --git a/src/utils/promise-barrier.ts b/src/utils/promise-barrier.ts
index 65a1cc76..fc1ad3c0 100644
--- a/src/utils/promise-barrier.ts
+++ b/src/utils/promise-barrier.ts
@@ -1,3 +1,9 @@
+export const PromiseBarrierState = {
+    PENDING: 'pending',
+    FULFILLED: 'fulfilled',
+    REJECTED: 'rejected',
+};
+
 export class PromiseBarrier {
     private resolves: Array<(value?: any) => void> = [];
     private rejects: Array<(reason?: any) => void> = [];
@@ -25,6 +31,8 @@ export class PromiseBarrier {
         this.wasResolved = true;
         this.resolution = value;
         this.resolves.forEach((resolve) => resolve(value));
+        this.resolves = null;
+        this.rejects = null;
         return new Promise<void>((resolve) => setTimeout(() => resolve()));
     }
 
@@ -35,6 +43,17 @@ export class PromiseBarrier {
         this.wasRejected = true;
         this.resolution = reason;
         this.rejects.forEach((reject) => reject(reason));
+        this.resolves = null;
+        this.rejects = null;
         return new Promise<void>((resolve) => setTimeout(() => resolve()));
     }
+
+    get state() {
+        if (this.wasResolved) {
+            return PromiseBarrierState.FULFILLED;
+        } else if (this.wasRejected) {
+            return PromiseBarrierState.REJECTED;
+        }
+        return PromiseBarrierState.PENDING;
+    }
 }


Test patch:
diff --git a/tests/utils/promise-barrier.tests.ts b/tests/utils/promise-barrier.tests.ts
index 2fcfeca2..53fb37e2 100644
--- a/tests/utils/promise-barrier.tests.ts
+++ b/tests/utils/promise-barrier.tests.ts
@@ -1,4 +1,4 @@
-import {PromiseBarrier} from '../../src/utils/promise-barrier';
+import {PromiseBarrier, PromiseBarrierState} from '../../src/utils/promise-barrier';
 
 test('Promise barrier utility', async () => {
     const barrier = new PromiseBarrier();
@@ -12,14 +12,18 @@ test('Promise barrier utility', async () => {
     expect(fn1).toBeCalled();
     expect(fn2).not.toBeCalled();
 
+    expect(barrier.state).toBe(PromiseBarrierState.PENDING);
     await barrier.resolve(2);
+    expect(barrier.state).toBe(PromiseBarrierState.FULFILLED);
     expect(fn1).toBeCalledTimes(1);
     expect(fn2).toBeCalledWith(2);
 });
 
 test('Promise barrier utility: awaiting for barrier after it was settled', async () => {
     const barrierResolved = new PromiseBarrier();
+    expect(barrierResolved.state).toBe(PromiseBarrierState.PENDING);
     const promise1 = barrierResolved.resolve('Hello World!');
+    expect(barrierResolved.state).toBe(PromiseBarrierState.FULFILLED);
     const fn1 = jest.fn();
     (async () => fn1(await barrierResolved.entry()))();
     await promise1;
@@ -41,14 +45,19 @@ test('Promise barrier utility: awaiting for barrier after it was settled', async
 
 test('Promise barrier utility: resolving multiple times', async () => {
     const barrierResolved = new PromiseBarrier();
+    expect(barrierResolved.state).toBe(PromiseBarrierState.PENDING);
     barrierResolved.resolve('Hello World!');
+    expect(barrierResolved.state).toBe(PromiseBarrierState.FULFILLED);
     barrierResolved.resolve('Hello World 2!');
+    expect(barrierResolved.state).toBe(PromiseBarrierState.FULFILLED);
     const fn1 = jest.fn();
     (async () => fn1(await barrierResolved.entry()))();
     setTimeout(() => expect(fn1).toBeCalledWith('Hello World!'));
 
     const barrierRejected = new PromiseBarrier();
+    expect(barrierRejected.state).toBe(PromiseBarrierState.PENDING);
     await barrierRejected.reject('rejection reason');
+    expect(barrierRejected.state).toBe(PromiseBarrierState.REJECTED);
     barrierRejected.reject('rejection reason 2');
     const fn2 = jest.fn();
     (async () => {