diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 4725cc6aa..92fa12da3 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -220,6 +220,7 @@ Valerie Enfys Julien Chol ikkz rreemmii-dev +babofitos ******************** diff --git a/qt/tools/genhooks_gui.py b/qt/tools/genhooks_gui.py index 1acfab1f9..f63a64f91 100644 --- a/qt/tools/genhooks_gui.py +++ b/qt/tools/genhooks_gui.py @@ -778,24 +778,24 @@ hooks = [ name="webview_did_inject_style_into_page", args=["webview: aqt.webview.AnkiWebView"], doc='''Called after standard styling is injected into an external -html file, such as when loading the new graphs. You can use this hook to -mutate the DOM before the page is revealed. - -For example: - -def mytest(webview: AnkiWebView): - if webview.kind != AnkiWebViewKind.DECK_STATS: - return - web.eval( - """ - div = document.createElement("div"); - div.innerHTML = 'hello'; - document.body.appendChild(div); -""" - ) - -gui_hooks.webview_did_inject_style_into_page.append(mytest) -''', + html file, such as when loading the new graphs. You can use this hook to + mutate the DOM before the page is revealed. + + For example: + + def mytest(webview: AnkiWebView): + if webview.kind != AnkiWebViewKind.DECK_STATS: + return + webview.eval( + """ + div = document.createElement("div"); + div.innerHTML = 'hello'; + document.body.appendChild(div); + """ + ) + + gui_hooks.webview_did_inject_style_into_page.append(mytest) + ''', ), # Main ###################