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
510
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
Googleのテストサイズを活用したテスト環境の構築
toms74209200
0
270
リリース8年目のサービスの1800個のERBファイルをViewComponentに移行した方法とその結果
katty0324
5
3.6k
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
250
CPython 인터프리터 구조 파헤치기 - PyCon Korea 24
kennethanceyer
0
250
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
140
Vue.js学習の振り返り
hiro_xre
2
130
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
400
Vaporモードを大規模サービスに最速導入して学びを共有する
kazukishimamoto
4
4.3k
ECSのサービス間通信 4つの方法を比較する 〜Canary,Blue/Greenも添えて〜
tkikuc
11
2.3k
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
930
VR HMDとしてのVision Pro+ゲーム開発について
yasei_no_otoko
0
100
Modern Angular: Renovation for Your Applications
manfredsteyer
PRO
0
210
Featured
See All Featured
It's Worth the Effort
3n
183
27k
Docker and Python
trallard
40
3.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
The Cult of Friendly URLs
andyhume
78
6k
What's new in Ruby 2.0
geeforr
342
31k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
800
Being A Developer After 40
akosma
86
590k
RailsConf 2023
tenderlove
29
880
Code Reviewing Like a Champion
maltzj
519
39k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
46
2.1k
The World Runs on Bad Software
bkeepers
PRO
65
11k
The Pragmatic Product Professional
lauravandoore
31
6.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)ͱ ֨ήʔ
͓͠·͍