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
520
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
590
macOS Sierra x Xcode 7 で AppStore に Submit できない問題にぶち当たった話
qmihara
0
510
Other Decks in Programming
See All in Programming
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
イベント駆動で成長して委員会
happymana
1
320
Jakarta EE meets AI
ivargrimstad
0
560
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
subpath importsで始めるモック生活
10tera
0
300
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
CSC509 Lecture 13
javiergs
PRO
0
110
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
180
Amazon Qを使ってIaCを触ろう!
maruto
0
410
Macとオーディオ再生 2024/11/02
yusukeito
0
370
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
130
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Typedesign – Prime Four
hannesfritz
40
2.4k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
The Invisible Side of Design
smashingmag
298
50k
Gamification - CAS2011
davidbonilla
80
5k
How GitHub (no longer) Works
holman
310
140k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
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)ͱ ֨ήʔ
͓͠·͍