Maximiliano Firtman's articles, notes and learning experiences for devs-firt.dev

Safari on iOS 7 and HTML5

Problems, changes and new APIs

Maximiliano Firtman avatarby Maximiliano Firtman Twitter @firt About Newsletter

About 18 min reading time

Apple has rolled out iOS 7 with iPhone 5S and iPhone 5C . As expected, Apple has published just 10% of the necessary information for web developers, and I can say without fear of mistake that this is the buggiest Safari version since 1.0. In this post I’ll show you the new APIs and abilities and most of the  problems that you will need to deal with right now if you have a website or a webapp.

In a nutshell #

Don’t have time for reading the long post?

  • UI Changes: toolbar tint, problems with new full-screen navigation, new home screen icon sizes; no <title> usage on iPhone; possible conflicts with new gestures.
  • New devices: nothing new about them for web developers, same as iPhone 5.
  • HTML5 markup: video tracks, <progress>, REMOVED support for input type=datetime
  • HTML5 APIs: Page Visibility, AirPlay API, canvas enhancements, REMOVED support for Shared Workers, Web Speech Synthesis API, unprefixed Web Audio and Animation Timing, Mutation Observer and other minor additions. BIG PROBLEM with WebSQL using more than 5Mb.
  • CSS: Regions, Sticky position, FlexBox, ClipPath, unprefixed Transitions and other enhancements
  • Home Screen webapps: SEVERAL SEVERE PROBLEMS (for example, no alert support!)
  • Native webapps: Web View Pagination, JavaScript runtime for native apps and video playing new abilities

The new browser #

Safari, as well as other native apps, has received the biggest update in the user interface and experience since version 1.0. These changes will affect how users interact with websites and how your webapp will react.

Toolbars’ tint #

Safari will now tint the toolbars (URL bar and bottom toolbar on iPhone) based on: a) the background color when loading the page and b) the current main color behind the bars while scrolling.

If you want to “hack” the initial tint and have different backgrounds for the body and the tint without adding noise to the HTML (such as new containers) just use the following CSS hack:

body {  
background-color: blue; /* for the tint */
background-image: linear-gradient(to bottom, green 0%, green 100%); /* for the body */
}

In this hack we define both background color and image; the content will use the image, in this case a gradient (it can also be a data URI 1px image). In the next examples, you can see the first two samples with the same color (just a background) and the last examples with one tint color and other background color for the body.

Tint on iOS7

Full screen and big problems for HTML5 apps and games #

Web browsing is now always in full screen on iPhone and iPod touch. When the user scrolls the page in portrait orientation, the bottom toolbar will disappear and the URL bar is transformed to a small semi- transparent bar at the top. On landscape, after the user scrolls the page the bottom toolbar and the Host domain bar will both disappear, leaving it in complete full-mode.

The toolbar and full URL bar will appear again when: 1) the user taps on the domain host at the top or 2) the user starts to scroll back to the top.

The next picture shows how the UI changes before and after scrolling in landscape and portrait mode:

Fullscreen

The problems are:

  • The resize event is not firing anymore when the toolbar is appearing/disappearing
  • We can’t detect changes with JavaScript or media queries
  • The old hack of using window.scrollTo to hide the URL bar doesn’t work anymore; therefore there is no way to hide the URL bar or toolbar without user’s intervention scrolling the page.
  • If you are not using a natural scroll, you will have problems (detailed below).
  • UPDATE 19/9: The bottom part of the canvas is not interactive anymore (details later)

If you are using a “non natural” scrolling layout, such as iframes, sections with overflow:scroll or a JavaScript-based scrolling mechanism, toolbars will never hide. And even more problematic, if somehow the user gets into fullscreen mode he will not be able to go back again to normal mode. As an example, see the Twitter website (using overflow: scroll) on landscape mode where your scrolling area is less than 50% of the screen and toolbars never go away.

iOS 7

To be honest, if you go portrait and then landscape again, sometimes, you will get full-screen without scrolling, but you can’t get out of it. You need to test it to get the idea of the problem.

Scrolling back to restore toolbars are making things complicate to HTML5 games also. Because this post has started in the Apple Forum while in Beta 1, lot of people were complaining about this problem, such as:

  • Richard Davey: “This is actually a real issue for us. It has broken the display of all of our games on the BBC site (try anything on http://www.bbc.co.uk/cbeebies/ for example). With the removal of the full-screen button and the removal of this ‘hack’ we’ve no way to make our games go full screen. So they are crammed into a tiny window in the middle of the browser on iPhones. (…) When you enter a page in landscape mode, only 2/3rd’s of the screen area is available. Controls cover a full 1/3rd of the screen.(…)
  • TheFlashGuy: “We need more control over the appearance / disappearance of the browser bars when in landscape mode. It’s far too easy for a user to break out of this mode just by touching the top or bottom of the screen. This breaks a lot of websites and web apps whose major ui nav elements tend to sit in the top or bottom of the content area”

There is no way to have a truly fullscreen experience on your website. This was one of the wonderful aspects of iOS 6, and losing it is a major step backwards. Richard Davey.

Game in fullscreen

Bottom toolbars and interactive elements (update 19/9) #

When in fullscreen mode, the bottom portion of the page is not interactive anymore. This problem affects any toolbar, link or form item that is in the bottom part of the viewport while in fullscreen mode (after scroll). For example, fixed toolbars at the bottom are one example.

When you click on that portion of the viewport, it doesn’t matter where do you click, it will just fire the full-screen dismiss action. Therefore, Safari toolbars will appear and you will need to tap again on the interactive item to activate it. Therefore, two taps for action a button for example. To test it go here, scroll and try to click on the bottom toolbar.

For example, if you try to click Albums in the next image, it will just open the Safari toolbar and you need to click Albums again to go there.

Bottom Toolbar

Title #

The next big change in Safari’s UI on iPhone is the title’s area. The page’s title on iPhone was replaced by the current host (the domain) as you can see in next image. The page’s title is only available when browsing tabs on iPhone.

iOS 7 removed the title

On iPhone with iOS 7 your page’s <title> will be ignored while the user is browsing the document

On iPad there is no fullscreen mode; the toolbar and title’s bar is always visible.

New Add to Home button #

iOS 7 has changed the Share icon and it has a new Add to Home Screen button.

The whole UI has changed, including new icons replacing the Share icon with a new style, so every website that is inviting the user to add it to bookmarks or to the Home Screen need to update the icon.

Gestures #

The operating system and Safari itself now offer new gestures that might impact your website, mostly if you are detecting gestures yourself.

A) Control Center: it appears when you swipe up from the bottom of the screen. In this version, because of the full screen, the bottom of the screen might be part of your website and not the Safari toolbar. Therefore, be careful when suggesting the user to do a swipe up from the bottom of the canvas.

B) History Gesture: The second and probably more problematic gesture is the swipe right and left from the borders; Safari will trigger the back and forward action in the browsing history à la Internet Explorer on Windows 8 mode. This gesture might have some conflicts with your website if you are inviting users to swipe left or right without some nice margins around (but to be honest, you have the same problem right now with Chrome too).

The problem is even weirder on single page webapps (inside Safari) when using the History API or using a hash hack to manage app states. When the user starts a back gesture, he will see two images of the same app, but the user will be on the same app. And when you have side-by-side scroll gestures, such as Yahoo! homepage you might have usability issues if the user starts the gesture from the border (it even trigger touch events for just a while):

The swipe right and left gesture from the borders will trigger a back or forward action in browser's history.

This gesture and the back animation (slide to the right) is also making conflict with some UI frameworks, such as jQuery Mobile or Sencha Touch as when the user gestures to go back, two animations will be rendered (by the browser and after that by the framework). Also, when the previous page was left at one specific scroll position, the snapshot during the slide animation is ok but then the page loads from the top, not keeping the scroll position.

There is no way to prevent these gestures as they are managed by the OS or the browser itself.

Hopefully, the History gestures are not available on home screen webapps or UIWebViews (such as PhoneGap apps)

Icon sizes #

The new OS icons are 5% bigger in 7.0 then in previous version, for example 120×120 on Retina iPhone devices instead of the previous 114×114. System icons are also flat now and they don’t have the shiny effect anymore, so we might want to update our icons to match the new design. To do that we can use the same apple-touch-icon link with the new sizes values.

The apple-touch-icon precomposed version is still supported but it will make same results as the apple-touch-icon as now there are no shiny effects anymore on icons. If we define both, the precomposed version will take precedence.

Available icon sizes for iOS 7 are:

  • iPhone / iPod Touch retina: 120×120
  • iPad non-retina (iPad 2 and iPad mini): 76×76
  • iPad retina: 152×152

We need to remember that iOS 7 is not available for any non-retina iPhone-factor device. If we don’t provide the new sizes, the device will pick the iOS 6 related one. If you want to cover all the possible icons for iOS, the code will look like:

<!-- non-retina iPhone pre iOS 7 -->  
<link rel="apple-touch-icon" href="icon57.png" sizes="57x57">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="icon72.png" sizes="72x72">
<!-- non-retina iPad iOS 7 -->
<link rel="apple-touch-icon" href="icon76.png" sizes="76x76">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="icon114.png" sizes="114x114">
<!-- retina iPhone iOS 7 -->
<link rel="apple-touch-icon" href="icon120.png" sizes="120x120">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="icon144.png" sizes="144x144">
<!-- retina iPad iOS 7 -->
<link rel="apple-touch-icon" href="icon152.png" sizes="152x152">

Bookmarks and Favorites #

While on bookmarks there are new icons available (see left image below), it seems there is no way to define those icons specifically yet, as well as the text.

For the favorites (see right image below) that appear when you click on the URL bar, it seems to use the apple-touch-icon link but it doesn’t follow any sizes rule and I’ve found weird situations, such as some websites with a proper link element that is not taking the icon for favorites.

Favorites

The new devices #

In a few days, the iPhone 5S and the iPhone 5C will be available on the market and the good news is that from a web development perspective they are exactly the same as the iPhone 5. Same screen size, same pixel density, same abilities. They may be faster, but nothing to worry about from a coding perspective.

The new Touch ID feature (fingerprint scanner) is not available to web sites yet and the 64-bit CPU will not change anything from a JavaScript developer’s perspective. Having said that, on the iOS Simulator now you have the ability to emulate a 64-bit CPU.

HTML5 markup support #

Video tracks #

The video HTML5 element now supports the track child for subtitles and/or closed captions. We can support multiple languages and they will appear in a picker inside the video player. The user can change the language and/or disable the captions from the track picker.

HTML Video track

For all the possible track types (kind attribute), it supports only captions and subtitles and we have to define the language in the srclang attribute in ISO format (such as en for English). Subtitles are useful when the user can hear the audio but she/he doesn’t understand the language and captions are for when the user can’t hear the audio, so it includes additional information about what is happening (such as ‘background musing playing’).

Closed-Caption menu

Defining the label attribute for track is worthless because on iOS it will be ignored and the language name will be used instead for the menu with an optional CC suffix if we are using captions instead of subtitles as the kind value.

<video>  
<source src="myvideo.mp4">
<track kind="captions" src="my-captions-en.vtt" srclang="en">
<track kind="subtitles" src="my-captions-fr.vtt" srclang="fr">
</video>

Tracks can be accessed through a JavaScript API and we can use it to loop through all the cues on the track file. That might be useful only on iPad where we can truly embed the video in the web canvas instead of a always fullscreen mode on iPhone.

Track elements should follow cross-domain policies, as by default, the video and track origins must be the same. Using JavaScript we can detect if tracks are available using webkitHasClosedCaptions as in

var hasCC = document.querySelector("video").webkitHasClosedCaptions;

We can also change captions visibility using webkitClosedCaptionsVisible boolean property of every video element.

Styling captions #

From a CSS perspective, iOS 7 supports the new ::cue pseudo-element but we can only change text-shadow, opacity and outline. All other properties, such as color and font styles are ignored.

::cue { opacity: 0.8 }

More about the Track element and API (have in mind that not all the API might work on Safari).

Progress and output elements #

The <progress> element is now supported, creating a progress bar on the screen based on max and value. There is no indeterminate progress support as in other browsers, so it’s only suitable when we know the determinate value of the activity’s progression.

<progress max="100" value="40">

The <output> element is now supported but I don’t think you will be so excited about it :).

About <meter> it seems to be supported, all the content is ignored but nothing is rendered on the screen, so I think it’s a bug.

REMOVED: Datetime input type #

Following Google Chrome, now Safari on iOS doesn’t support the datetime input type anymore and it will fallback to text. This type was deprecated in the standard in favor of datetime-local or using two inputs, date and time for the same purpose. The problem is that datetime was compatible with iOS from version 5.0 to 6.1; if you are using it, be careful!

The week input type is still not available, but now instead of falling back to a text input type, it’s rendered a non-interactive control

datetime was remmoved

If you are using a input type=”datetime” you should act immediately as it is now rendered as a text input type.

Seamless iframe #

The new boolean seamless attribute for iframes is now available on iOS 7 that will create a borderless iframe in your website. The iframe will not have scrollbars and, by default, it will get the height of the inner content appearing in the website as using the space of any other block element in the DOM.

<iframe seamless src="mypage.html"></iframe>

HTML5 JavaScript APIs #

Let’s start with bad news: no WebGL, FullScreen, WebRTC, getUserMedia or IndexedDB support yet.

In terms of new APIs available we have:

  • Page Visibility API
  • XHR 2.0 full implementation
  • Video tracks API (already covered)
  • AirPlay API
  • CSS Regions API
  • Canvas enhancements
  • Removed support for Shared Workers
  • WebSpeech Synthesis API

Page Visibility is the API -webkit-prefixed on iOS 7- to detect when our tab goes foreground and background. You can try a live demo here. XMLHttpRequest 2.0 spec fully compatible means that now we can request ‘blob’ as a response. The Video tracks API was already covered quickly and it allow us to query and navigate through all the tracks and contents on any media element.

The CSS regions API appears as part of the CSS Regions spec (covered later) and is basically the prefixed webkitGetFlowByName function available on every DOM element.

About the Canvas 2D Drawing API, we have now the globalCompositeOperation attribute on the canvas context that allows us to define the blending mode (such as multiply) when drawing different a layer on top of other. We also have a new Path constructor that we can then draw on the canvas’ context allowing us to store these paths for later usage instead of drawing them directly on the canvas.

AirPlay API #

The AirPlay API needs some explanation. AirPlay is the wireless streaming solution from Apple that allows some devices to stream content to different other devices, for now usually an Apple TV. While Safari already supported x-webkit-airplay HTML attribute to define if we want AirPlay or not, we couldn’t customize the experience from HTML5 before.

The API allows us to customize the player and get information and events about streaming through AirPlay. Every video element has the eventswebkitplaybacktargetavailabilitychanged and webkitcurrentplaybacktargetiswirelesschanged. They remind us how terrible is the idea of not using underscores, camel case or other technique for event names convention in JavaScript :S. The first event will fire when there is a new AirPlay target -such as an Apple TV- available or it’s not available anymore; and the second when the playback status on one target has changed.

I think webkitcurrentplaybacktargetiswirelesschanged has won the record: the longest JavaScript event name ever.

If there is a streaming target available, we can then offer the user a button to pick the target calling the video webkitShowPlaybackTargetPicker function.

While there is no official documentation on this API yet, you can check the video  ‘What’s New in Safari and WebKit for Web Developers’  from the WWDC session where they covered this topic.

Background execution #

Now we have several use cases for background execution:

  • If the user is changing tab (Tab selection screen), your code is still executing but the image is frozen
  • If the user is changing apps (multitasking mode), your code is still executing and the image is updated
  • If Safari is in foreground but your website is in a background tab, your code is frozen and Safari has a snapshot of your last execution for UI purposes
  • If Safari is in background your code is frozen

WebSpeech Synthesis API #

UPDATE 19/9: I could make this API work, so it is officially supported and working.

The WebSpeech API allow the website to record and transcript audio, as well as synthesize text to voice using internal voices in the operating system.

Safari on iOS 7 includes just the Synthesis API (text to speech) but not the APIs for listening for audio from the microphone. You can query on all the available voices to speak in different languages and on a real device it is returning 36 voices (sometimes you refresh the page and you get 0, a bug I think) using speechSynthesis.getVoices(). In terms of English, you have female voice using en-US and male voice using en-GB. I’m not an expert in voice recognition but I feel that the voices in this API are not the same as Siri that sounds much natural in iOS 7.

To make JavaScript to speak from your website you can use a shortcut version in the default language or you can define different properties as the following examples:

speechSynthesis.speak(new SpeechSynthesisUtterance("Hello, this is my voice on a webpage"));
var speech = new SpeechSynthesisUtterance();  
speech.text = "Hello";
speech.volume = 1; // 0 to 1
speech.rate = 1; // 0.1 to 9
speech.pitch = 1; // 0 to 2, 1=normal
speech.lang = "en-US";
speechSynthesis.speak(speech);

From the SpeechSynthesisUtterance object we can also bind to some events, such as start and end but please don’t use alert inside those events or your whole Safari will freeze (don’t ask me why).

The speakable string can be just plain text. While the standard supports also an XML document in SSML format (Speech Synthesis Markup Language) for input, Safari on iOS is just reading the XML :).

It’s important to keep in mind that the Speech Synthesis API works only after a user’s explicit action, such as clicking on a button so you can’t initiate a speech on the onload or on a time-base. Try this online demo browsing to ad.ag/jmawam on your iOS7 device

Other changes #

  • MutationObserver
  • Unprefixed Animation Timing API (also known as requestAnimationFrame)
  • Unprefixed transitionend event name
  • Unprefixed URL
  • Unprefixed WebAudio API and new advanced abilities
  • New DOM properties hidden and visibilityState
  • window.doNotTrack support

WebSQL bug #

  • Using WebSQL API will have big issues (DOMException) while trying to create a database bigger than 5Mb. On previous versions, the limit was 50Mb with user’s permission. Because of a bug, when you try to store more than 5Mb the user will get a permission dialog but just for 5Mb only. Even if the user grants you permission because it’s for 5Mb only, you will get an exception trying to get more. It’s a BIG BUG.

Update 19/9: According to tarobomb from New York Times, if you request less than 5Mb when you first create the database and then you try to store more data (up to 50Mb) the proper confirmation dialog will appear (first 10Mb, then 25Mb and finally 50Mb) and you will finally be able to store more than 5Mb.

Update 22/10: This bug is still there on 7.0.3 update.

CSS Support #

In terms of new specs supported (mostly webkit prefixed) we have:

  • Sticky Position
  • CSS Regions
  • CSS Grid Layout (not working)
  • CSS FlexBox
  • Dynamic Font types

Sticky position #

Sticky position is a new experimental feature that allow us to fix an element to the viewport but only when it’s off the visible area (usually after a scrolling action). It’s like mixing position: static with position: fixed when the static position moves the element outside of the visible viewport. If you have more than one sticky element, they will all accumulate in the same area -defining same position properties- creating a nice effect while scrolling similar to native UITableView sections.

UPDATE 19/9: Some reports indicate that this feature was available on 6.1 as well (but the community didn’t get it so I’ll keep it here).

h1 {
position: -webkit-sticky;
top: 10px;
}

You can try a demo.
Position Sticky on iOS7

CSS Regions #

With CSS Regions -spec proposed by Adobe- we can create magazine-like designs to flow content through different containers. Because of the nature of the screen size we’ll use this new flow mechanism more on iPad websites and webapps.

Selecting content flowing into different regions is not allowed on iOS. CSS Exclusions, a way to define shapes for regions, usually coming as a Regions companion, is not available yet.

You can try some online demos

CSS Grid Layout #

CSS Grid Layout is other layout new spec from the W3C (proposed by Microsoft and already available in IE10). All the new CSS properties (-webkit-grid-X) are there available but I couldn’t enable using display: grid or display: -webkit-grid. I’m not sure if there is a different way to enable it or is it that it’s not ready yet.

CSS FlexBox #

The final spec for CSS FlexBox is finally here and it allow us to stop insulting floats and clear everywhere to layout elements horizontally and/or vertically. To use it we should use display: -webkit-flex to a container and apply different properties available

Dynamic Fonts #

Dynamic fonts are a new font type available in iOS 7 that adjusts weight, letter-spacing and leading based on current font size to improve legibility. We can take advantage of this new feature from HTML, using new -apple- prefixed constants (maybe because webkit is not going to use prefixes in the future?). We have a big list of constant, such as -apple-system-headline1, -apple-system-body and -apple-system-caption1.

h1 { font: -apple-system-headline1 }  
p { font: -apple-system-body }

Other CSS improvements #

There is no good news for media queries as resolution attribute is still not supported. Well, there is something new, such as the ability to query on min-color-index and max-color-index that is completely useless :)

We also have some minor updates, including:

  • Unprefixed CSS Transitions (and the transitionend event).
  • CSS Clip Path to clip contents based on shapes, including circle, rectangles and polygons
  • Kerning and Ligatures on fonts are enabled by default
  • Background properties now gets more compatibility with different values
  • box-decoration-break: slice/clone
  • tab-size style
  • overflow-wrap: normal/hypernate/break-word
  • support for the units ch and vmax
  • mask-type: alpha
  • new ::cue pseudo-element already covered in the video track section
  • New -webkit-background-composite property (but I couldn’t make it work)

Home-screen webapps #

If you are using Home Screen webapps, I have bad news for you: too many bugs are around this platform in this version.

The only good news is now it seems we don’t have any limits for WebSQL Storage when in full screen; we don’t need user’s permission.

Big issues #

There are some big issues on home-screen webapps:

  • Standard dialogs are not working at all, such as alert, confirm or prompt.Update 22/10: iOS 7.0.3 solves this bug
  • Webapps can’t open an external URI, such as a website in Safari, make a call, open AppStore, etc. Any URI is just ignored.Update 22/10: iOS 7.0.3 solves this bug
  • If you install more than 4 apps, the home screen will do strange things, such as replacing one webapp with another one. You will start seeing clones of the same webapp. The same happens when you open different webapps at the same time. Just try it on your device: go to app.ft.com, install the webapp; go to pattern.dk/sun, install the webapp; repeat the operation several times and you will see the mess on your home screen. Restarting the device seems to solve the problem.
  • When in portrait mode and a text input, a select or a date picker is in focus, media queries will honor orientation: landscape and the resize event will fire. This behavior (bug?) happens on home screen webapps and Web Views, but not on Safari.
  • UPDATE 19/9: If you are using Application Cache and also managing states through hash or other technique, the history object will not keep your navigation history, therefore history.back() will never work and history.length stays in 1 forever. (Thanks to 10+ people who reported this problem!)
  • UPDATE 19/9: Cookies are not transferred between your website and your webapp when installing the icon on the home screen (for authentication purposes for example). It was working until 6.1 and now it’s not working anymore. (Thanks Joseph Pearson for reporting this; a test suite here.)

Status bar #

If you don’t provide any apple-mobile-web-app-status-bar-style meta tag or if you provide one with the default value, the status bar will become black over black, so… just a black area on the screen (on some devices you will see just the battery icon). The user will not see the clock and all the other icons on the status bar. Update 22/10: iOS 7.0.3 still has this bug

The black value works ok but it’s not in full mode as in iOS 7 new style. Lastly, If you are defining the apple-mobile-web-app-status-bar-style as black-translucent it’s not black-based anymore, it’s just fully transparent following the new iOS full-screen mode for apps (previous image, at the right). Unfortunately it seems there is no way to define if our background is clear or dark so we need to test how the icons and clock look like over our background. UPDATE: The text seems to be always white.

In the next picture you can see the default status bar, the black value and the black-translucent value in action on iOS7.

Status bar for home screen webapps

Launch image and multitasking #

For the new multitasking system, when having a home screen webapp, the system is using a white image, not the launch image and not the current status of the app for the preview. The only exception is when the webapp is still the active app where you see the right snapshot. In the next example, we can see the Financial Times webapp with a white snapshot even with a correct Launch image and an active execution.

White screen bug

Luckily we don’t have the iPhone 5 bug for home screen webapps anymore that was letterboxing the app (a year after it was found). We don’t need the viewport hack solution anymore.

Native webapp development #

If you are developing hybrid (native webapps), such as Apache Cordova (PhoneGap) apps, there are some news for you. First, no Nitro engine yet.

Paginate mode #

When using UIWebView for rich content in native apps or for native webapps (hybrids), we can now use a Paginate feature for an ebook reading experience without vertical scrolling (a la Windows 8 app experience). This feature is perfect if on the app we are showing dynamic content, so we can’t pre-optimize it for pagination. We have different Objective-C properties to configure the pagination process. To enable it, we need to use something like:

myWebView.paginationMode = UIWebPaginationModeLeftToRight;  
myWebView.paginationBreakingMode = UIWebPaginationBreakingModePage;
myWebView.gapBetweenPages = 50;

These properties will convert any HTML document in the web view in pagination mode (divided horizontally in pages).

Other improvements #

  • For native development -not necessarily using Web View- the iOS SDK now includes a JavaScript runtime: JavaScript Core framework providing wrapper Objective-C for standard JavaScript objects. We can use this framework to evaluate JavaScript code and also parse JSON
  • With a new property of the Web View, we can now have inline playback mode for HTML5 video instead of the default full screen mode
  • With a new property of the Web View, we can enable autoplay for video when in a native webapp.
  • There is also a SafariServices Framework that on iOS 7 is useful to programmatically add URL’s to Safari reading list.

Remote debugging #

If you have a MacOS and you are used to remote debugging with your iOS, you must update Safari to version 6.1 and iTunes to version 11.1 to have the ability to communicate with an iOS 7.0 device. At the time of this writing, Safari 6.1 is only available as a Preview.

While the abilites inside the debugger are the same as in the previous version the user interface has changed a lot with a much cleaner design.

Not there yet #

While the list is big, in this case I will list features that were announced for Safari 7 for Mac but are not there on Safari on iOS:

  • Web Speech API (it’s there but it’s not working on iOS)
  • Push Notifications from websites. This will be a great addition to iOS but it will only be on Mac OS.
  • Background Blend mode
  • Grid Layout (it’s there but it’s not working on iOS)

Anything else? #

Most of the bugs and problems in this post were posted a few months ago in the private forum and lot of people have sent bug reports and ask desperately on the forum for a solution. I can’t believe that Apple can’t give answers to web developers and they are not event executing some basic test suites to detect some API bugs.

Did you found any other API or support? Any other bug? Feel free to add your comments below using any of the options available.

This article was first published in mobilexweb.com blog no longer mantained. Public comments were available at the time, and they were removed when re-published.

Half typewriter, half computer

© Maximiliano Firtman (@firt)

firt.dev contains a collection of writings, thoughts, notes and learning experiences for web and mobile app developers authored by Maximiliano Firtman.

Contact me: [email protected] Personal Website Buy Me A Coffee

" + document.querySelector("h1").innerHTML; titleChanged = true; } else { if (titleChanged) { document.querySelector(".header-title").innerHTML = original; titleChanged = false; } } }, false);