Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>AZORult</title>
- <link rel="stylesheet" href="css/style.css">
- <link rel="stylesheet" href="css/menu.css">
- <script src="js/snippets.js"></script>
- <meta charset="utf-8">
- </head>
- <body>
- <div class="page-all">
- <div class="page-header">
- <div class="page-header-logo">
- </div>
- </div>
- <div class="page-content">
- <div class="page-left-bar">
- <div id='cssmenu'>
- <ul>
- <li %1%><a href='?page=home'><span>Main page</span></a></li>
- <li %2%><a href='?page=reports'><span>Reports list</span></a></li>
- <li %3%><a href='?page=passwords'><span>Passwords</span></a></li>
- <li class='active has-sub'><a href='?page=cookiesconverter'><span>cookies converter</span></a></li>
- <li><a href='?page=logout'><span>Logout</span></a></li>
- </ul>
- </div>
- </div>
- <div class="page-data">
- <div class="info-text1">
- <center>Cookies converter: Netscape to JSON</center>
- <script>
- window.onload=function(){
- document.getElementById("textarea1").wrap='off';
- }
- function NetscapeToJson(){
- var textArea2 = document.getElementById("textarea2");
- textArea2.value = '';
- var arrObjects = [];
- var textArea1 = document.getElementById("textarea1");
- var arrayOfLines = textArea1.value.split("\n");
- var i = 0;
- for (i=0; i<arrayOfLines.length; i++){
- var kuka = arrayOfLines[i].split("\t");
- var cook = new Object();
- cook.domain = kuka[0];
- cook.expirationDate = parseInt(kuka[4]);
- if (kuka[1] == "FALSE") cook.httpOnly = false;
- if (kuka[1] == "TRUE") cook.httpOnly = true;
- cook.name = kuka[5];
- cook.path = kuka[2];
- if (kuka[3] == "FALSE") cook.secure = false;
- if (kuka[3] == "TRUE") cook.secure = true;
- cook.value = kuka[6];
- arrObjects[i] = cook;
- }
- var cookieStr = JSON.stringify(arrObjects);
- textArea2.value = cookieStr;
- }
- </script>
- <h3>NETSCAPE: </h3>
- <textarea id = "textarea1" wrap="soft" rows="20" style="width: 100%" onclick="this.select()"></textarea>
- <br>
- <button onclick="NetscapeToJson()" class="sbutton"> Convert >>> </button>
- <br>
- <br>
- <h3>JSON: </h3>
- <textarea id = "textarea2" wrap="soft" rows="20" style="width: 100%" onclick="this.select()"></textarea>
- </div>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement