Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
WKWebViewの知られざるプロパティ/ Unknown properties of WKW...
Search
Kyusaku Mihara
August 25, 2023
Programming
0
540
WKWebViewの知られざるプロパティ/ Unknown properties of WKWebView
https://dena.connpass.com/event/291447/
Kyusaku Mihara
August 25, 2023
Tweet
Share
More Decks by Kyusaku Mihara
See All by Kyusaku Mihara
bitcode を有効にしたアプリでも dSYM のアップロードを自動化する
qmihara
6
4.2k
iOSDC Japan 2017 で犯した失敗
qmihara
0
600
macOS Sierra x Xcode 7 で AppStore に Submit できない問題にぶち当たった話
qmihara
0
510
Other Decks in Programming
See All in Programming
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
200
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
3
370
Go の GC の不得意な部分を克服したい
taiyow
3
780
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
210
モバイルアプリにおける自動テストの導入戦略
ostk0069
0
110
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
Zoneless Testing
rainerhahnekamp
0
120
命名をリントする
chiroruxx
1
400
ドメインイベント増えすぎ問題
h0r15h0
2
300
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
33
1.5k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
RailsConf 2023
tenderlove
29
940
A Modern Web Designer's Workflow
chriscoyier
693
190k
Designing Experiences People Love
moore
138
23k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
The Language of Interfaces
destraynor
154
24k
It's Worth the Effort
3n
183
28k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Transcript
2023.08.24 @qmihara WKWebViewͷ ΒΕ͟ΔϓϩύςΟ ެ։ SwiftWednesday
WKWebViewɺ ͬͯ·͢ΑͶʁ
WKWebView.interactionState ͬͯ·͔͢ʁ
https://developer.apple.com/documentation/webkit/wkwebview/3752236-interactionstate
“WebϏϡʔͰͷରͷݱࡏͷঢ়ଶΛΩϟϓνϟͯ͠ɺޙͰผ ͷWebϏϡʔʹͦͷঢ়ଶΛ෮ݩͰ͖ΔΑ͏ʹ͢ΔͨΊʹ༻ ͢ΔΦϒδΣΫτɻ”
WebViewͷ ঢ়ଶͷอଘͱ෮ݩ
อଘ
෮ݩ
Կ͠ͳ͍ͱ͜͏
ঢ়ଶͷอଘͱ෮ݩ Λ͢Δͱ͜͏
؆୯Ͱ͢Ͷʂ😊
ͱ͜ΖͰɺ interactionStateͷਖ਼ମʁ
https://developer.apple.com/documentation/webkit/wkwebview/3752236-interactionstate Anyܕ…ͩͱ…ʁ
{length = 4073, bytes = 0x00000002 62706c69 73743030 d3010203 ...
00000000 00000f77 } ͱΓ͋͑ͣ ͦͷ··ग़ྗͯ͠ΈΔͱ (NS)DataΆ͋͞Γ
“nil” Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character È at line 1"
UserInfo={NSDebugDescription=Unexpected character È at line 1, kCFPropertyListOldStyleParsingError=Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character '0x200' at line 1"
StringͰͳ͘ɺplistͰͳ͍
όΠφϦΤσΟλͰݟͯΈΑ͏
None
த plist ͬΆ͍ʁ
None
ઌ಄4όΠτԿ͜Εʁ
ͪͳΈʹόΠφϦܗࣜͷplist͜͏ (UserDefaultsͷplist)
ઌ಄4όΠτͬͯΈΔͱʁ
{ IsAppInitiated = 1; RenderTreeSize = 1241; SessionHistory = {
SessionHistoryCurrentIndex = 2; SessionHistoryEntries = ( …
None
ಡΈࠐΊͨʂ
https://github.com/WebKit/WebKit/blob/887ce26d210b05a9b5ebee1abc46da02901b8586/Source/ WebKit/UIProcess/mac/LegacySessionStateCoding.cpp#L503-L507
ਖ਼ମ plist ͷόΠφϦσʔλ+ઌ಄4 όΠτʹόʔδϣϯใ
interactionState iOS 15 Ҏ্͔Β
iOS 15 ະຬటष͍ΓํͰࣗ ͰؤுΔ͔͠ͳ͍
Ͳ͏ͬͯʁ
https://github.com/mozilla-mobile/firefox-ios/wiki/History-Restoration-in-WKWebView-(and-Error-Pages) ࢀߟใ(Firefox for iOS)
Firefox for iOS ͷཤྺཧํ๏؆୯ࡶઆ໌ • WKWebView.backForwardList ͷதΛநग़͠ӬଓԽ • ෮ݩ࣌ϩʔΧϧHTMLϑΝΠϧΛ·ͣಡΈࠐ·ͤɺΫΤϦύϥϝʔλͰཤ ྺใΛͯͦ͠ΕΛ
history.replaceState() ʹΑͬͯཤྺʹੵΜͰ͍͘
WKWebView ͷঢ়ଶͷอଘͱ෮ݩΛ࣮ݱ͍ͨ͠ͳ Βɺѱ͍͜ͱݴΘͳ͍ͷͰ Deplyment Target Λ iOS 15 ʹͯ͠ interactionState
Λ͓͏ ·ͱΊ
αϯϓϧͪ͜Β
ͯͨ͠ਓ • Kyusaku Mihara (@qmihara) • SkyLeapͷ։ൃͱϚωʔδϟʔ Λ͍ͬͯ·͢ • झຯࣸਅࡱӨ(📷SIGMA
fp)ͱ ֨ήʔ
͓͠·͍