manager: add webview padding if no request from insets css#3083
Merged
Conversation
- Also expose ksu.enableInsets() for js to enable/disable webview insets. - Since not all webui support insets, insets now is disabled by defaule, but if web request resource from `internal/insets.css`, insets will be enabled once automatically. - No changes are required for current WebUI. This makes insets feature fully opt-in only, web that doesn't support inset will not be affected anymore. - Usecase: if a webui want to use inset, it can request insets css at first, but if it want to load external webpage in current window afterwards then it can use ksu.enableInsets(false) to disable insets. Signed-off-by: KOWX712 <leecc0503@gmail.com>
Signed-off-by: KOWX712 <leecc0503@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the webview insets feature opt-in to prevent affecting WebUIs that don't support insets. The insets are now disabled by default and automatically enabled when internal/insets.css is requested. Additionally, a JavaScript interface ksu.enableInsets() is exposed to allow WebUIs to dynamically control insets behavior.
Key changes:
- Insets feature is now disabled by default with automatic opt-in when
internal/insets.cssis requested - Added
ksu.enableInsets()JavaScript interface for runtime insets control - WebView is now wrapped in a FrameLayout container with conditional padding based on insets state
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| WebViewInterface.kt | Adds enableInsets() JavaScript interface method to allow web content to control insets |
| WebUIActivity.kt | Wraps WebView in a FrameLayout container, moves insets listener to container, adds conditional padding logic, and implements enableInsets() method |
| SuFilePathHandler.java | Adds OnInsetsRequestedListener interface and callback to notify when internal/insets.css is requested |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aviraxp
pushed a commit
that referenced
this pull request
Dec 21, 2025
KOWX712
added a commit
to KOWX712/KernelSU
that referenced
this pull request
Dec 21, 2025
- Also expose ksu.enableInsets() for js to enable/disable webview insets. - Since not all webui support insets, insets now is disabled by default, but if web request resource from `internal/insets.css`, insets will be enabled once automatically. - No changes are required for current WebUI. This makes insets feature fully opt-in only, web that doesn't support inset will not be affected anymore. - Usecase: if a webui want to use inset, it can request insets css at first, but if it want to load external webpage in current window afterwards then it can use ksu.enableInsets(false) to disable insets. Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KernelSU
that referenced
this pull request
Dec 21, 2025
documentation for tiann#2952, tiann#3083 Signed-off-by: KOWX712 <leecc0503@gmail.com>
rsuntk
pushed a commit
to rsuntk/KernelSU
that referenced
this pull request
Dec 21, 2025
- Also expose ksu.enableInsets() for js to enable/disable webview insets. - Since not all webui support insets, insets now is disabled by default, but if web request resource from `internal/insets.css`, insets will be enabled once automatically. - No changes are required for current WebUI. This makes insets feature fully opt-in only, web that doesn't support inset will not be affected anymore. - Usecase: if a webui want to use inset, it can request insets css at first, but if it want to load external webpage in current window afterwards then it can use ksu.enableInsets(false) to disable insets. Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/APatch
that referenced
this pull request
Dec 23, 2025
sync tiann/KernelSU#2952, tiann/KernelSU#3083 add insets support to WebUI, no change are required for existing WebUI module. Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
bklynali
pushed a commit
to bklynali/BK-KSU
that referenced
this pull request
Dec 23, 2025
- Also expose ksu.enableInsets() for js to enable/disable webview insets. - Since not all webui support insets, insets now is disabled by default, but if web request resource from `internal/insets.css`, insets will be enabled once automatically. - No changes are required for current WebUI. This makes insets feature fully opt-in only, web that doesn't support inset will not be affected anymore. - Usecase: if a webui want to use inset, it can request insets css at first, but if it want to load external webpage in current window afterwards then it can use ksu.enableInsets(false) to disable insets. Signed-off-by: KOWX712 <leecc0503@gmail.com>
bklynali
pushed a commit
to bklynali/BK-KSU
that referenced
this pull request
Dec 23, 2025
documentation for tiann#2952, tiann#3083 Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Dec 24, 2025
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Dec 24, 2025
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Dec 24, 2025
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Dec 28, 2025
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Dec 28, 2025
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Dec 28, 2025
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KernelSU
that referenced
this pull request
Jan 1, 2026
since insets is toggeable in tiann#3083, fullScreen will only toggle system bar but not insets. This commit restore how fullScreen function like previous version, both system bar and insets are toggled simultaniously. Signed-off-by: KOWX712 <leecc0503@gmail.com>
aviraxp
pushed a commit
that referenced
this pull request
Jan 1, 2026
since insets is toggeable in #3083, fullScreen will only toggle system bar but not insets. This commit restore how fullScreen function like previous version, both system bar and insets are toggled simultaniously. Signed-off-by: KOWX712 <leecc0503@gmail.com>
rsuntk
pushed a commit
to rsuntk/KernelSU
that referenced
this pull request
Jan 3, 2026
since insets is toggeable in tiann#3083, fullScreen will only toggle system bar but not insets. This commit restore how fullScreen function like previous version, both system bar and insets are toggled simultaniously. Signed-off-by: KOWX712 <leecc0503@gmail.com> Signed-off-by: rsuntk <rissu.ntk@gmail.com>
KOWX712
added a commit
to KOWX712/KernelSU
that referenced
this pull request
Jan 3, 2026
since insets is toggeable in tiann#3083, fullScreen will only toggle system bar but not insets. This commit restore how fullScreen function like previous version, both system bar and insets are toggled simultaniously. Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 5, 2026
- Also expose ksu.enableInsets() for js to enable/disable webview insets. - Since not all webui support insets, insets now is disabled by default, but if web request resource from `internal/insets.css`, insets will be enabled once automatically. - No changes are required for current WebUI. This makes insets feature fully opt-in only, web that doesn't support inset will not be affected anymore. - Usecase: if a webui want to use inset, it can request insets css at first, but if it want to load external webpage in current window afterwards then it can use ksu.enableInsets(false) to disable insets. Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 5, 2026
documentation for tiann#2952, tiann#3083 Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 5, 2026
since insets is toggeable in tiann#3083, fullScreen will only toggle system bar but not insets. This commit restore how fullScreen function like previous version, both system bar and insets are toggled simultaniously. Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 5, 2026
- Also expose ksu.enableInsets() for js to enable/disable webview insets. - Since not all webui support insets, insets now is disabled by default, but if web request resource from `internal/insets.css`, insets will be enabled once automatically. - No changes are required for current WebUI. This makes insets feature fully opt-in only, web that doesn't support inset will not be affected anymore. - Usecase: if a webui want to use inset, it can request insets css at first, but if it want to load external webpage in current window afterwards then it can use ksu.enableInsets(false) to disable insets. Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 5, 2026
documentation for tiann#2952, tiann#3083 Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 5, 2026
since insets is toggeable in tiann#3083, fullScreen will only toggle system bar but not insets. This commit restore how fullScreen function like previous version, both system bar and insets are toggled simultaniously. Signed-off-by: KOWX712 <leecc0503@gmail.com>
Prslc
pushed a commit
to Prslc/APatch
that referenced
this pull request
Jan 6, 2026
sync tiann/KernelSU#2952, tiann/KernelSU#3083 add insets support to WebUI, no change are required for existing WebUI module. minor touch up manager: fix ksu.fullScreen ref: tiann/KernelSU#3126 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 8, 2026
- Also expose ksu.enableInsets() for js to enable/disable webview insets. - Since not all webui support insets, insets now is disabled by default, but if web request resource from `internal/insets.css`, insets will be enabled once automatically. - No changes are required for current WebUI. This makes insets feature fully opt-in only, web that doesn't support inset will not be affected anymore. - Usecase: if a webui want to use inset, it can request insets css at first, but if it want to load external webpage in current window afterwards then it can use ksu.enableInsets(false) to disable insets. Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 8, 2026
documentation for tiann#2952, tiann#3083 Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 8, 2026
since insets is toggeable in tiann#3083, fullScreen will only toggle system bar but not insets. This commit restore how fullScreen function like previous version, both system bar and insets are toggled simultaniously. Signed-off-by: KOWX712 <leecc0503@gmail.com>
Admirepowered
pushed a commit
to bmax121/APatch
that referenced
this pull request
Jan 10, 2026
sync tiann/KernelSU#2952, tiann/KernelSU#3083 add insets support to WebUI, no change are required for existing WebUI module. Signed-off-by: KOWX712 <leecc0503@gmail.com> Co-authored-by: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-authored-by: Light_summer <93428659+lightsummer233@users.noreply.github.com>
Prslc
pushed a commit
to Prslc/APatch
that referenced
this pull request
Jan 11, 2026
sync tiann/KernelSU#2952, tiann/KernelSU#3083 add insets support to WebUI, no change are required for existing WebUI module. minor touch up manager: fix ksu.fullScreen ref: tiann/KernelSU#3126 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 13, 2026
- Also expose ksu.enableInsets() for js to enable/disable webview insets. - Since not all webui support insets, insets now is disabled by default, but if web request resource from `internal/insets.css`, insets will be enabled once automatically. - No changes are required for current WebUI. This makes insets feature fully opt-in only, web that doesn't support inset will not be affected anymore. - Usecase: if a webui want to use inset, it can request insets css at first, but if it want to load external webpage in current window afterwards then it can use ksu.enableInsets(false) to disable insets. Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 13, 2026
documentation for tiann#2952, tiann#3083 Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 13, 2026
since insets is toggeable in tiann#3083, fullScreen will only toggle system bar but not insets. This commit restore how fullScreen function like previous version, both system bar and insets are toggled simultaniously. Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 13, 2026
since insets is toggeable in tiann#3083, fullScreen will only toggle system bar but not insets. This commit restore how fullScreen function like previous version, both system bar and insets are toggled simultaniously. Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 13, 2026
since insets is toggeable in tiann#3083, fullScreen will only toggle system bar but not insets. This commit restore how fullScreen function like previous version, both system bar and insets are toggled simultaniously. Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 14, 2026
since insets is toggeable in tiann#3083, fullScreen will only toggle system bar but not insets. This commit restore how fullScreen function like previous version, both system bar and insets are toggled simultaniously. Signed-off-by: KOWX712 <leecc0503@gmail.com>
u9521
pushed a commit
to u9521/KernelSU
that referenced
this pull request
Jan 20, 2026
since insets is toggeable in tiann#3083, fullScreen will only toggle system bar but not insets. This commit restore how fullScreen function like previous version, both system bar and insets are toggled simultaniously. Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Feb 8, 2026
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
LeCmnGend
pushed a commit
to LeCmnGend/KernelSU
that referenced
this pull request
Feb 23, 2026
- Also expose ksu.enableInsets() for js to enable/disable webview insets. - Since not all webui support insets, insets now is disabled by default, but if web request resource from `internal/insets.css`, insets will be enabled once automatically. - No changes are required for current WebUI. This makes insets feature fully opt-in only, web that doesn't support inset will not be affected anymore. - Usecase: if a webui want to use inset, it can request insets css at first, but if it want to load external webpage in current window afterwards then it can use ksu.enableInsets(false) to disable insets. Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Mar 11, 2026
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Mar 11, 2026
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/KsuWebUIStandalone
that referenced
this pull request
Apr 14, 2026
ref: tiann/KernelSU#2952, tiann/KernelSU#3083 Co-Authored-By: Der_Googler <54764558+dergoogler@users.noreply.github.com> Co-Authored-By: Light_summer <93428659+lightsummer233@users.noreply.github.com> Signed-off-by: KOWX712 <leecc0503@gmail.com>
KOWX712
added a commit
to KOWX712/FolkPatch
that referenced
this pull request
May 29, 2026
The WebUI failed to load CSS/JS assets because the WebView was configured and loadUrl was called inside the AndroidView factory during Compose composition, which blocked the main thread and called loadUrl before the WebView had valid dimensions. Refactor to match the KernelSU pattern: - Create WebView and configure WebViewAssetLoader on IO dispatcher - Build WebView fully on Main thread outside AndroidView - Defer loadUrl until width > 0 && height > 0 via layout listener - related: - tiann/KernelSU#2952 - tiann/KernelSU#3083 - tiann/KernelSU#3126 - tiann/KernelSU#3190 Signed-off-by: KOWX712 <leecc0503@gmail.com>
matsuzaka-yuki
pushed a commit
to LyraVoid/FolkPatch
that referenced
this pull request
May 30, 2026
#151) The WebUI failed to load CSS/JS assets because the WebView was configured and loadUrl was called inside the AndroidView factory during Compose composition, which blocked the main thread and called loadUrl before the WebView had valid dimensions. Refactor to match the KernelSU pattern: - Create WebView and configure WebViewAssetLoader on IO dispatcher - Build WebView fully on Main thread outside AndroidView - Defer loadUrl until width > 0 && height > 0 via layout listener - related: - tiann/KernelSU#2952 - tiann/KernelSU#3083 - tiann/KernelSU#3126 - tiann/KernelSU#3190 Signed-off-by: KOWX712 <leecc0503@gmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
internal/insets.css, insets will be enabled once automatically.Signed-off-by: KOWX712 leecc0503@gmail.com