완전 모바일처럼 보이기 위한 북마크 URL 스크립트


1. 북마크를 연다

2. 북마크 추가를 눌러 URL 부분에 하단 스크립트를 삽입하여 저장한다

3. 북마크에 추가된 페이지를 누르면 끝



javascript: (function() {var d = document; if (d.getElementById('ifm_wrap')) {alert('이미 실행중입니다.'); return false; } var html = ''; html += '<!doctype html>'; html += '<html lang="en">'; html += '<head>'; html += '<meta charset="UTF-8">'; html += '<title>반응형 테스트</title>'; html += '<style>'; html += 'iframe::-webkit-scrollbar {'; html += 'width: 0px;'; html += 'height: 10px;'; html += '}'; html += 'html,body{margin:0;padding:0;background: transparent url("https://t1.daumcdn.net/cfile/tistory/270E724656EAD4052E") repeat;}'; html += '#ifm_wrap{margin: 80px auto 0; width: 360px; height: 640px; border: 3px solid #000; background-color: #000; border-radius: 30px; padding: 40px 0px;box-shadow:0 12px 25px rgba(0,0,0,0.25);position:relative;}'; html += '#ifm_wrap > .button{display: table;width: 100%;height: 3.5%;position: absolute;left: 0;bottom: 1%;} #ifm_wrap > .button p{width: 100%;height: 100%;display: table-cell;vertical-align: baseline;text-align: center;} #ifm_wrap > .button p span{display: inline-block;width: 30%;height: 100%;border:1px solid #7A7A7A;border-radius: 100px;background-color:#333;} #ifm_wrap.h{width: 640px;height: 360px;} #ifm_wrap.h > .button{width: 3.5%;height: 100%;left: auto;bottom: auto;right: 1%;} #ifm_wrap.h > .button p{width: 100%;height: 100%;text-align: left;vertical-align: middle;} #ifm_wrap.h > .button p span{width: 100%;height: 30%;}'; html += '#ifm_wrap.h{padding:0px 40px;}'; html += '#ifm_wrap .btn{display:block;}'; html += '#ifm_wrap,#rw{transition: all 0.35s ease-out;}'; html += '#rw{background-color: #fff}'; html += '#buttons{z-index:1;min-width:978px;text-align: center; padding: 10px; width: 100%; height: 30px; background-color: #f1f1f1; position: fixed; left: 0; top: 0; border-bottom: 1px solid #ccc;}'; html += '#buttons button{border: 1px solid #000; border-radius: 12px; padding: 2px 13px; background-color: #000; color: #fff;}'; html += '</style>'; html += '</head>'; html += '<body id="body">'; html += '<div id="buttons">'; html += '<button>360*640</button>'; html += '<button>320*533</button>'; html += '<button>320*598</button>'; html += '<button>360*640</button>'; html += '<button>400*640</button>'; html += '<button>400*683</button>'; html += '<button>320*568</button>'; html += '<button>320*480</button>'; html += '<button>384*640</button>'; html += '<button>439*585</button>'; html += '<button>%ED%9A%8C%EC%A0%84</button>'; html += '</div>'; html += '</body>'; html += ''; html += '</html>'; html += ''; document.write(html); d.body.insertAdjacentHTML('beforeend', '<div id="ifm_wrap"><div class="button"> <p id="dv_btn"> <span></span> </p> </div><iframe src="about:blank" id="rw" frameborder="0" scrolling="yes" style="overflow:hidden;margin: 0 auto;width:100%;height:100%;display: block;"></iframe></div>'); var ifrm = d.getElementById('rw'); ifrm.src = window.location.href; function ifr_resize(w, h) {var ifrm = document.getElementById('ifm_wrap'); var ifrm_style = ifrm.style; var getComputedStyle = window.getComputedStyle(document.getElementById('ifm_wrap'), null); if (w == '%ED%9A%8C%EC%A0%84') {var ori_res = (String(getComputedStyle.getPropertyValue('width')) + '*' + String(getComputedStyle.getPropertyValue('height'))).split('*'); ifrm_style.width = ori_res[1]; ifrm_style.height = ori_res[0]; if (ifrm.getAttribute('class') == 'null' || ifrm.getAttribute('class') == 'h') {ifrm.setAttribute('class', 'v'); } else {ifrm.setAttribute('class', 'h'); } } else {ifrm.setAttribute('class', ''); ifrm_style.width = w + 'px'; ifrm_style.height = h + 'px'; } } d.getElementById('buttons').addEventListener('click', function(e) {if (e.target && e.target.nodeName == 'BUTTON') {var size = e.target.innerText.split('*'); ifr_resize(size[0], size[1]); } }); d.getElementById('dv_btn').addEventListener('click', function(e) {if (e.target && e.target.nodeName == 'SPAN') {ifrm.contentWindow.location.reload(); } }); })();

'Common' 카테고리의 다른 글

[wallpaper] 눈편한 색  (0) 2016.01.29
한글 Putty  (0) 2015.01.06
Have a fun ! 해커 타이핑  (0) 2014.01.22
[스킨] 티스토리용  (0) 2013.11.01
[Window Error] werfault.exe 응용프로그램 오류  (0) 2013.05.20

+ Recent posts