Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Mobile Web Application 甘苦談
Search
othree
October 27, 2013
Technology
6
1.7k
Mobile Web Application 甘苦談
othree
October 27, 2013
Tweet
Share
More Decks by othree
See All by othree
How GitHub Supports Vim License Detection, The Five Years Journey
othree
1
2.1k
WAT JavaScript Date
othree
3
2.1k
Modern HTML Email Development
othree
3
2.7k
MRT & GIT
othree
1
2.2k
YAJS.vim and Vim Syntax Highlight
othree
1
3k
Web Trends to 2015
othree
4
330
Transducer
othree
9
3k
HITCON 11 Photographer
othree
4
500
fetch is the new XHR
othree
6
3.6k
Other Decks in Technology
See All in Technology
AWS Security Agentの紹介/introducing-aws-security-agent
tomoki10
0
380
ペアーズにおけるAIエージェント 基盤とText to SQLツールの紹介
hisamouna
2
1.3k
Agent Skillsがハーネスの垣根を超える日
gotalab555
5
2.9k
特別捜査官等研修会
nomizone
0
520
AIの長期記憶と短期記憶の違いについてAgentCoreを例に深掘ってみた
yakumo
4
470
re:Invent2025 3つの Frontier Agents を紹介 / introducing-3-frontier-agents
tomoki10
0
350
AgentCore BrowserとClaude Codeスキルを活用した 『初手AI』を実現する業務自動化AIエージェント基盤
ruzia
7
790
Strands AgentsとNova 2 SonicでS2Sを実践してみた
yama3133
1
1.5k
アプリにAIを正しく組み込むための アーキテクチャ── 国産LLMの現実と実践
kohju
0
170
【開発を止めるな】機能追加と並行して進めるアーキテクチャ改善/Keep Shipping: Architecture Improvements Without Pausing Dev
bitkey
PRO
1
100
「図面」から「法則」へ 〜メタ視点で読み解く現代のソフトウェアアーキテクチャ〜
scova0731
0
460
ZOZOの独自性を生み出す「似合う4大要素」の開発サイクル
zozotech
PRO
0
110
Featured
See All Featured
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
48
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Music & Morning Musume
bryan
46
7k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
850
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
A designer walks into a library…
pauljervisheath
210
24k
Transcript
Mobile Web Application ⽢甘苦談 othree @ MOPCON 2013
me • @othree • MozTW member • PhD Candidate of
civil engineering • F2E at HTC • https://blog.othree.net/
• Front End related • Experience sharing • No code
listing
Why Mobile • We are HTC....
Mozilla Summit 2013
Mozilla Summit 2013
PM Says “We are going to support mobile browsers”
What We Thought • Web Standards rule the web •
Not big problem
Reality • Browser have bugs • Standard implementation not the
same • Ambiguous standards • Hard to debug on some browser • Any issue might be new, not like IE
Reality • Browser have bugs • Standard implementation not the
same • Ambiguous standards • Hard to debug on some browser • Any issue might be new, not like IE Survey
What browser you use on smartphone?
What browser you use on smartphone? b) You install browser
by yourself a) Default browser from your phone
Android Browser
Android Browser • No updates anymore • Google use Chrome
as new default • Still exists: HTC, Samsung Galaxy S3
Mozilla Summit 2013
• Have bugs, issues
S4 Chrome?
S4 Chrome?
None
Suggestion to Users • Use Chrome or Firefox or …
So...
So... Issues
Issues • No repaint • Ghost Click • Toggle location
bar will not trigger resize • preventDefault not work on touch event • HTML5 Video
Repaint • To save power, browser will reduce repaint •
It predicts best timing for repaint, what to repaint • Prediction might fail
If Not Repaint • Things will disappear, in wrong position...etc
Force Repaint • Access some attribute related to layout •
ex: offsetHeight
Ghost Click • Mobile device don’t have real ‘click’ event
• Simulate ‘click’ using touch events • ‘click’ has 300ms delay after ‘touchend’
Avoid Lag • Use ‘touchend’ • tap.js https://github.com/alexgibson/tap.js • fastbutton
https://developers.google.com/mobile/ articles/fast_buttons
But.. • Android Browser • Trigger simulated click on wrong
element
Demo
Location Bar • 3 states in Android Browser • show
• hide • pinned
Location Bar • 3 states in Android Browser • show
• hide • pinned
None
None
None
What’s the Deal • Window size changes • Trigger ‘resize’
event? • Android 2: Yes • Android 3: No http://www.quirksmode.org/dom/events/resize_mobile.html
Fix • Time Interval to check window size change •
200ms interval will cause video not play • Manuel trigger resize handler when window size might change
preventDefault • Can used to prevent user scroll web page
• Not work on HTC browser • Not a bug, its spec...
HTML5 Video • Loop not work • Play event not
reliable • Duration update issue • iPhone, iPod have different implementation
Loop • Video loop not work on all mobile browser
• But you can call `play()` on ‘ended’ event
Video Bugs • ‘play’, ‘playing’ event not reliable • Duration
have default value • Won't stop when buffer ready even if `pause()` were called
MOPCON 2013
pause() not work play() download buffer pause() buffer ready, play
playing play
RobustVideo • A video wrapper to fix issues above •
https://github.com/othree/robust-video
iPhone • Open native player to play HTML5 video
iPhone • Open native player to play HTML5 video
None
None
Limitation • Video needs visible to be able to play
• Poster will not used to render in web page • No video event is available
Limitation • Video needs visible to be able to play
• Poster will not used to render in web page • No video event is available
Tip • Video element outside of window • Tap img(poster)
to trigger `video.play()`
Tip • Video element outside of window • Tap img(poster)
to trigger `video.play()` <video> <img>
呼...
Next Time PM Says “We are going to support mobile
browsers”
We Say “Well, it takes x times longer to do
it.”
We Say “Well, it takes x times longer to do
it.” Mobile Debugging How to
Browsers • Safari • Chrome • Firefox/Opera • Android Browser
Safari • Enable Debug • Connect iDevice to your Mac
• Open Safari https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/DebuggingSafarioniPhoneContent/DebuggingSafarioniPhoneContent.html
Chrome • Install the ADB Chrome extension • Install driver
of your device • Enable Debug • Connect device to PC/Mac https://developers.google.com/chrome-developer-tools/docs/remote-debugging
None
Firefox • https://hacks.mozilla.org/2012/08/remote- debugging-on-firefox-for-android/
Android Browser • Weinre http://people.apache.org/~pmuellr/weinre/ docs/latest/
None
None
None
None
None
Demo Q
Thanks