1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-10-11 05:31:56 +00:00
* Fixed: Rewrite our player code to support the Highwind player. This removes support for the old player, but to our knowledge everyone should be using Highwind now.
* Removed: The Reset Player button. At this time we just don't know how to properly implement it for the new player. The new player is more tightly integrated into the Twitch web application.
* Removed: Closed Captioning position settings. Twitch appears to have native position controls for closed captions now.
This commit is contained in:
SirStendec 2019-10-17 17:07:58 -04:00
parent 29414beaa0
commit 6547497d02
10 changed files with 433 additions and 475 deletions

View file

@ -77,8 +77,8 @@ export default class Fine extends Module {
return instance.return;
}
getParentNode(instance) {
if ( instance._reactInternalFiber )
getParentNode(instance, max_depth = 100, traverse_roots = false) {
/*if ( instance._reactInternalFiber )
instance = instance._reactInternalFiber;
else if ( instance instanceof Node )
instance = this.getReactInstance(instance);
@ -87,11 +87,13 @@ export default class Fine extends Module {
if ( instance.stateNode instanceof Node )
return instance.stateNode
else
instance = instance.parent;
instance = instance.parent;*/
return this.searchParent(instance, n => n instanceof Node, max_depth, 0, traverse_roots);
}
getChildNode(instance, max_depth = 100) {
if ( instance._reactInternalFiber )
getChildNode(instance, max_depth = 100, traverse_roots = false) {
/*if ( instance._reactInternalFiber )
instance = instance._reactInternalFiber;
else if ( instance instanceof Node )
instance = this.getReactInstance(instance);
@ -104,7 +106,9 @@ export default class Fine extends Module {
if ( max_depth < 0 )
return null;
instance = instance.child;
}
}*/
return this.searchTree(instance, n => n instanceof Node, max_depth, 0, traverse_roots);
}
getHostNode(instance, max_depth = 100) {
@ -243,6 +247,25 @@ export default class Fine extends Module {
}
findAllMatching(node, criteria, max_depth=15, parents=false, depth=0, traverse_roots=true) {
const matches = new Set,
crit = n => ! matches.has(n) && criteria(n);
while(true) {
const match = parents ?
this.searchParent(node, crit, max_depth, depth, traverse_roots) :
this.searchTree(node, crit, max_depth, depth, traverse_roots);
if ( ! match )
break;
matches.add(match);
}
return matches;
}
searchAll(node, criterias, max_depth=15, depth=0, data, traverse_roots = true) {
if ( ! node )
node = this.react;