Fix and add workaround for cookie banner blocking login (#381)
* Constraint cookie banner description height * Add workaround instructions for cookie banner blocking
This commit is contained in:
parent
5a374f74bc
commit
e297e38178
2 changed files with 57 additions and 4 deletions
|
|
@ -84,12 +84,42 @@ abstract class AuthBase with Store {
|
|||
}
|
||||
|
||||
WebViewController createAuthWebViewController({Widget? routeAfter}) {
|
||||
return WebViewController()
|
||||
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
||||
final webViewController = WebViewController()
|
||||
..setJavaScriptMode(JavaScriptMode.unrestricted);
|
||||
|
||||
return webViewController
|
||||
..setNavigationDelegate(
|
||||
NavigationDelegate(
|
||||
onNavigationRequest: (request) =>
|
||||
handleNavigation(request: request, routeAfter: routeAfter),
|
||||
onPageFinished: (_) => webViewController.runJavaScript(
|
||||
'''
|
||||
{
|
||||
function modifyElement(element) {
|
||||
element.style.maxHeight = '20vh';
|
||||
element.style.overflow = 'auto';
|
||||
}
|
||||
|
||||
const observer = new MutationObserver((mutations) => {
|
||||
for (let mutation of mutations) {
|
||||
if (mutation.type === 'childList') {
|
||||
const element = document.querySelector('.fAVISI');
|
||||
if (element) {
|
||||
modifyElement(element);
|
||||
observer.disconnect();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
observer.observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
}
|
||||
''',
|
||||
),
|
||||
),
|
||||
)
|
||||
..loadRequest(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue