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
MCP with Cloudflare Workers
yusukebe
2
220
Recoilを剥がしている話
kirik
5
6.7k
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
470
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
100
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
360
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
770
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
命名をリントする
chiroruxx
1
410
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
110
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Practical Orchestrator
shlominoach
186
10k
A better future with KSS
kneath
238
17k
Optimising Largest Contentful Paint
csswizardry
33
3k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
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)ͱ ֨ήʔ
͓͠·͍