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
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
330
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
290
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
Click-free releases & the making of a CLI app
oheyadam
2
110
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
330
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
100
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Better Code Design in PHP
afilina
PRO
0
120
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
120
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Ruby is Unlike a Banana
tanoku
97
11k
Embracing the Ebb and Flow
colly
84
4.5k
How GitHub (no longer) Works
holman
310
140k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Faster Mobile Websites
deanohume
305
30k
RailsConf 2023
tenderlove
29
900
Producing Creativity
orderedlist
PRO
341
39k
Done Done
chrislema
181
16k
Fireside Chat
paigeccino
34
3k
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)ͱ ֨ήʔ
͓͠·͍