반응형

Is Safari on iOS 6 caching $.ajax results?

$.ajaxPrefilter(function (options, originalOptions, jqXHR) {
   
// you can use originalOptions.type || options.type to restrict specific type of requests
    options
.data = jQuery.param($.extend(originalOptions.data||{}, {
      timeStamp
: new Date().getTime()
   
}));
});


iOS6 Safari orientation change bug?

Safari Overflow Hidden Problem

There may be times when you need to hide the overflow (scrollbars) being visible on a page. You can specify to have all scrollbars hidden or the x and y scroll bars separately. When trying to hide the overflow of a project I was working on I realized that the ‘overflow:hidden’ was not working on the Safari browser. This was very frustrating because it worked on all other browsers except Safari. Well, there is a very simple solution to solve this problem… All you have to do is set that element to have a relative position. For instance, if you were to specify for the body to hide the horizontal scrollbars you would want to have the following css in your stylesheet:

 
body {
	position:relative;
	overflow-x:hidden;
}

iOS 6 Beta 1: HTML5 new APIs, Remote Debugging and native apps integration

Public new features for Safari on iOS 6

File uploads

Finally! We can now select an image from the Photo Library or opening the Camera from a web form. The question is about HTML Media Capture being implemented or not (see later for the answer).

Web Audio API

With the Web Audio API we can enhance HTML5 games and multimedia apps with mixing, filtering and processing operations through JavaScript.

CSS Filters

CSS 3 Filters a set of image operations (filters) that we can apply using CSS functions, such as grayscale, blur, drop-shadow, brightness and other effects. These functions will be applied before the content is rendered on screen. We can use multiple filters using spaces (similar to transforms).

Smart App Banners

It’s a way to connect websites to native applications. When you browse a web that has a related native application, Safari can show a banner inviting the user to install or open the native app. The website can also send parameters to the native app. It’s not clear how this is going to be implemented. My guess is through meta tags. The same behavior is available on Internet Explorer 10 for Windows 8.

Full Screen support on landscape

When you orient your device in landscape mode you can then move to a full-screen mode, including hiding the status bar and the Safari toolbar at the bottom. Transparent buttons are replacing the toolbar. A similar behavior is available on Nokia Browser for Symbian.  It’s not clear at this point if we can use the FullScreen API to request the feature (see later for the answer)

Remote Web Inspector

This is a big feature. Announced as a very small feature in the new APIs for developers. In the keynote there was no other information. As you may know, I’ve developed iWebInspector for iOS 5 because of the lack (or the hiding) of a web inspector tool for debugging web apps. It’s not public if this new Remote Web Inspector through LAN (like BlackBerry Remote Web Inspector) or through USB (like Google Chrome for Android)… the answer, later in this post.

Crossfade CSS Function

This feature was published in the keynote with “font-face: 3px” but I’ve seen it. It’s an image function that will create a crossfade between two images (Spec draft), for example:

1.background-image: -webkit-cross-fade(url("image1.png"),  url("image2.png"), 40%);

Will it work with transitions?

Other announced features and questions

iCloud Tabs

You can synchronize your tabs between all your devices, including Macs, iPhones and iPads. So the same URL will be distributed through all devices. Be careful on your mobile web architecture!

Offline Reading List

when the user adds a page to the reading list it will be also downloaded and precache. Is there any API to know if our page is being executed from the cache?

Maps

Google Maps native app was replaced by a new Maps app (directly from Apple). The question is, is this app still capturing http://maps.google.com URLs? (I hope not) and how to open the native app or driving instructions from a web.

Twitter and Facebook

Both social networks are not integrated in the operating system. It will be good if at some point web apps can also use these credentials.

Questions from the past

WebGL? IndexedDB? getUserMedia (camera access)? Nitro engine on Web Views?

반응형
반응형

iOS6 SAFARI BUG (iOS6 사파리 버그 - AJAX, SPINNING, ...)

아이폰5 발표가 되고 조금 지나서 iOS6도 공개가 되었다.


업데이트평은

인터넷 접근 속도가 빨라졌다.

OS 전체적으로 조금 빨라졌다 라는 평이 많고..

일부 아이폰 4이하 기기를 사용하시는 분들은 느려졌다는 의견도 좀 있다.



뭐.. 그런저런 이야기는 지나가고..


개발을 하고 사용하다 보니 문제가 발생했다.

바로바로...

AJAX caching bug


사이트에서 페이지가 바뀌지 않은 상태에서

AJAX를 재호출 했을 경우 이전에 받았던 데이터를 그냥 계속 불러오는 버그가 발생하였다.


예상되는 버그 시나리오



* 최초로 A data("test.jsp")를 요청

   1. 서버로 A data를 요청

   2. 서버에서 Safari로 전달

   3. Safari에서는 해당 데이터를 캐쉬에 저장

   4. A data 제공


* 이후에 A data("test.jsp")를 요청

   1.  Safari Cache에 해당 데이터가 있는지 확인

   2.  Cache에 있는 A data 제공



해당 문제가 발생하는 이유

브라우저가 인터넷 속도를 빠르게 하기 위해서 캐시를 사용을 하게 된다.

이럴 경우 같은 주소에 대해서는 캐시를 사용하면서 생기는 문제로 보인다.



해결책


1. 주소에 쓰레기 값을 붙여서 새로운 주소로 인식하도록 한다.

ex) test.jsp?timeStamp=93939393


2. meta cache control을 추가해준다.

ex) <meta http-equiv="Cache-Control" content="no-cache" />


3. 서버 HEADER를 추가해준다.

ex) header('cache-control: no-cache');



1, 2번을 함께 적용하여 해결을 했다.


관련 URL를 참고하면 자세한 정보가 나와있으니 참고하도록.





아......... 애플.. ㅡ.ㅡ;;


ps.

iOS6 Webview에서도 동일한 증상이 발견된다.

즉............. 어플도 확인해봐야한다는 말씀?!



관련 URL

Understanding the iOS6 AJAX bugs

http://www.devthought.com/2012/09/22/understanding-the-ios6-ajax-bugs/

1. The spinning bug

2. The AJAX cache bug

3. The long-polling bug


Is Safari on iOS 6 caching $.ajax results?

http://stackoverflow.com/questions/12506897/is-safari-on-ios-6-caching-ajax-results


AJAX Web Apps In iOS 6 Are Sort Of Broken

http://techcrunch.com/2012/09/21/ajax-web-apps-in-ios-6-are-sort-of-broken/



반응형
반응형

  IOS6 업데이트 이후 세션 문제


- IOS 6.0 사파리 브라우져의 [쿠키허용] 정책 변경

- 기존 설정 (쿠키 허용에 대한 정책 설정)으로는 결제시 안심클릭 카드사 인증에 대한 세션을 유지하지 못하게 되면

결제 진행 불가 (카드사 인증창 호출 불가)현상 발생 할 수 있음

 

1. 기존(IOS 6.0이전) 쿠키 허용 기본 값 : “방문한 곳” or “항상” 설정시 결제이용 가능 (세션유지가 가능)

2. 변경(IOS 6.0 이후) : “항상” 설정 시에만 세션유지 가능. “방문한곳”, “안함” 일 경우 세션 단절


반응형
반응형

 Integrating input[type="file"] with the Filesystem API

 - http://updates.html5rocks.com/tag/file-access


: http://html5-demos.appspot.com/static/dnd/all_types_of_import.html

Launch Demo

In a recent post, Eiji Kitamura highlighted a subtle, yet powerful new feature in the drag and drop APIs; the ability to drag in folders and retrieve them as HTML5 Filesystem API FileEntry and DirectoryEntry objects (done by accessing a new method on the DataTransferItem, .webkitGetAsEntry()).

What's remarkably cool about the .webkitGetAsEntry() extension is how elegant it makes importing files and entire folders. Once you have a FileEntry or DirectoryEntry from a drop event, it's a matter of using the Filesystem API's copyTo() to get it imported into your app.

An example of copying multiple dropped folders over to the filesystem:

var fs = null; // Cache filesystem for later.

// Not shown: setup drag and drop event listeners.
function onDrop(e) {
  e.preventDefault();
  e.stopPropagation();

  var items = e.dataTransfer.items;

  for (var i = 0, item; item = items[i]; ++i) { 
    var entry = item.webkitGetAsEntry();

    // Folder? Copy the DirectoryEntry over to our local filesystem.
    if (entry.isDirectory) {
      entry.copyTo(fs.root, null, function(copiedEntry) {
        // ...
      }, onError);
    }
  }
}

window.webkitRequestFileSystem(TEMPORARY, 1024 * 1204, function(fileSystem) {
  fs = fileSystem;
}, function(e) {
  console.log('Error', e);
});

Very nice! Again, the simplicity comes from integrating DnD with the Filesystem API calls.

Taking this one step further, we also have the ability to drag and drop a folder and/or files onto a normal <input type="file">, then access the entries as Filesystem directory or file entries. That is done through .webkitEntries:

<input type="file" multiple>

function onChange(e) {
  e.stopPropagation();
  e.preventDefault();

  var entries = e.target.webkitEntries; // Get all dropped items as FS API entries.

  [].forEach.call(entries, function(entry) {

    // Copy the entry into our local filesystem.
    entry.copyTo(fs.root, null, function(copiedEntry) {
      ...
    }, onError);

  });
}

document.querySelector('input[type="file"]').addEventListener('change', onChange);

I've put together a photo gallery demo to demonstrate these different techniques for importing files/folders.

Launch Demo

To learn more about the HTML5 Filesystem API, see Exploring the Filesystem APIs.

반응형
반응형

http://www.apple.com/kr/ios/whats-new/






반응형

+ Recent posts