Skip to content

Commit

Permalink
Night mode fix: Better handling of tags within <a> links
Browse files Browse the repository at this point in the history
  • Loading branch information
alandau committed May 25, 2020
1 parent 5b52b8c commit 57d3f52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "landau.sweb"
minSdkVersion 21
targetSdkVersion 26
versionCode 4
versionName "1.3"
versionCode 5
versionName "1.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/landau/sweb/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,7 @@ private void injectCSS(WebView webview) {
"if (!window.night_mode_id_list) night_mode_id_list = new Set();" +
"var newset = new Set();" +
" for (var n of document.querySelectorAll(':not(a)')) { " +
" if (n.closest('a') != null) continue;" +
" if (!n.id) n.id = 'night_mode_id_' + (night_mode_id_list.size + newset.size);" +
" if (!night_mode_id_list.has(n.id)) newset.add(n.id); " +
" }" +
Expand Down

0 comments on commit 57d3f52

Please sign in to comment.