-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2751 from uProxy/jab-workarounds-all-the-way-down
- Loading branch information
Showing
5 changed files
with
43 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// CCA-specific workarounds. | ||
|
||
(function () { | ||
// Force a repaint every 300 ms. | ||
// Extremely hacky workaround for https://crbug.com/612836 | ||
|
||
let sendResize = true; | ||
|
||
setInterval(function () { | ||
if (sendResize) { | ||
window.dispatchEvent(new Event('resize')); | ||
} else { | ||
console.debug('suppressed resize event'); | ||
} | ||
}, 300); | ||
|
||
// Workaround for janky inviteUserPanel transition, | ||
// which is caused by the workaround above. | ||
// https://github.com/uProxy/uproxy/issues/2659 | ||
document.addEventListener('uproxy-root-ready', function () { | ||
// The 'uproxy-root-ready' event is dispatched in the `ready()` method of | ||
// the uproxy root object instantiated in src/generic_ui/polymer/root.ts. | ||
console.debug('got uproxy-root-ready'); | ||
let inviteButton = document.querySelector('uproxy-root /deep/ #inviteButton'); | ||
if (!inviteButton) { | ||
console.error('#inviteButton missing:', inviteButton); | ||
return; | ||
} | ||
inviteButton.addEventListener('tap', function () { | ||
sendResize = false; | ||
setTimeout(function () { sendResize = true; }, 2000); | ||
}); | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters