이전 목록 다음

모바일에서 pc버전 사.이트 접속 (브라우저상 유저에이전트 조작 불가)

2014-06-22 (일) 20:21:32 8,973
예시로
http://domain.com 라는 사이트가 있습니다.
본 사이트는 모바일로 접속하면 http://m.domain.com 이라는 모바일에 최적화된 페이지가 뜹니다.

http://domain.com를 iframe에 넣고 

a.html
Copy
<html>
<head></head>
<body>
<iframe src="http://domain.com" width="200px" height="500px" frameborder="0" scrolling="yes"></iframe>
</body>
</html>

모바일에서 a.html 에 접속하면 pc용 페이지 http://domain.com 에 접속되게 하려고 합니다.


a.html 의 head에 하단의 스크립트를 넣어봤는데
Copy
navigator.__defineGetter__('appName', function(){
    return( "Netscape" );
  });
  navigator.__defineGetter__('appVersion', function(){
    return( "5.0 (Windows NT 6.1; WOW64) AppleWebkit/537.36 (KHTML,LIKE Gecko) Chrome/35.0.1916.153. Safari/537.36" );
  });
  navigator.__defineGetter__('userAgent', function(){
    return( "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebkit/537.36 (KHTML,LIKE Gecko) Chrome/35.0.1916.153. Safari/537.36" );
  });
  navigator.__defineGetter__('appCodeName', function(){
    return( "Mozilla" );
  });
  navigator.__defineGetter__('platform', function(){
    return( "Win32" );
  });

 모바일접속시 모바일화면이 드더라고요..

이거 어떻게 해결할 수 있을까요
|

답변 1개

질문이 너무 오래되고 답변이 없어서,  필요하면 다시 질문해주세요.

답변을 작성하려면 로그인이 필요합니다.