Advertisement
NewBestPastebins

Local Storage Editor | E-Gangster Edition

Apr 2nd, 2025 (edited)
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const hackerPopup = document.createElement("div");
  2. hackerPopup.id = "hackerLocalStoragePopup";
  3. hackerPopup.innerHTML = `
  4.     <div id="hackerPopupHeader">
  5.         <span>💀 Local Storage Terminal</span>
  6.         <button id="hackerClosePopup"></button>
  7.     </div>
  8.     <div id="hackerStorageList"></div>
  9. `;
  10. document.body.appendChild(hackerPopup);
  11.  
  12. const hackerEditPopup = document.createElement("div");
  13. hackerEditPopup.id = "hackerEditPopup";
  14. hackerEditPopup.innerHTML = `
  15.     <div id="hackerEditHeader">
  16.         <span>⚠️ MODIFY DATA</span>
  17.         <button id="hackerCloseEditPopup"></button>
  18.     </div>
  19.     <div id="hackerEditContent">
  20.         <p id="hackerEditKey"></p>
  21.         <textarea id="hackerEditValue"></textarea>
  22.         <button id="hackerApplyEdit">💾 Save Changes</button>
  23.     </div>
  24. `;
  25. document.body.appendChild(hackerEditPopup);
  26.  
  27. const hackerStyle = document.createElement("style");
  28. hackerStyle.innerHTML = `
  29.     #hackerLocalStoragePopup, #hackerEditPopup {
  30.         position: fixed;
  31.         top: 50%;
  32.         left: 50%;
  33.         transform: translate(-50%, -50%);
  34.         width: 400px;
  35.         max-height: 500px;
  36.         overflow-y: auto;
  37.         background: #111;
  38.         border: 2px solid #0f0;
  39.         border-radius: 10px;
  40.         box-shadow: 0 0 15px rgba(0, 255, 0, 0.75);
  41.         padding: 15px;
  42.         display: none;
  43.         z-index: 1000;
  44.         text-shadow: 0 0 5px #0f0;
  45.     }
  46.     #hackerPopupHeader, #hackerEditHeader {
  47.         display: flex;
  48.         justify-content: space-between;
  49.         align-items: center;
  50.         font-weight: bold;
  51.         font-size: 16px;
  52.         border-bottom: 2px solid #0f0;
  53.     }
  54.     #hackerClosePopup, #hackerCloseEditPopup {
  55.         background: none;
  56.         border: none;
  57.         font-size: 18px;
  58.         cursor: pointer;
  59.         color: #f00;
  60.         text-shadow: 0 0 5px #f00;
  61.     }
  62.     #hackerClosePopup:hover, #hackerCloseEditPopup:hover {
  63.         color: #ff0;
  64.     }
  65.     .hackerStorageItem {
  66.         padding: 10px;
  67.         border-bottom: 1px dashed #0f0;
  68.         cursor: pointer;
  69.         background: #050;
  70.         border-radius: 6px;
  71.         margin-bottom: 5px;
  72.         transition: background 0.3s ease, transform 0.2s ease;
  73.     }
  74.     .hackerStorageItem:hover {
  75.         background: #0a0;
  76.         transform: scale(1.02);
  77.     }
  78.     .hackerPreview {
  79.         font-size: 12px;
  80.         color: #0f0;
  81.         margin-top: 3px;
  82.         word-wrap: break-word;
  83.     }
  84.     #hackerEditValue {
  85.         width: 100%;
  86.         height: 100px;
  87.         margin-top: 10px;
  88.         border: 1px solid #0f0;
  89.         padding: 8px;
  90.         font-size: 14px;
  91.         background: black;
  92.         color: #0f0;
  93.         text-shadow: 0 0 5px #0f0;
  94.     }
  95.     #hackerApplyEdit {
  96.         margin-top: 10px;
  97.         width: 100%;
  98.         padding: 10px;
  99.         background: #0f0;
  100.         color: black;
  101.         border: none;
  102.         cursor: pointer;
  103.         border-radius: 6px;
  104.         font-size: 14px;
  105.         transition: background 0.2s ease;
  106.     }
  107.     #hackerApplyEdit:hover {
  108.         background: #ff0;
  109.     }
  110. `;
  111. document.head.appendChild(hackerStyle);
  112.  
  113. function updateHackerStorageList() {
  114.     const listContainer = document.getElementById("hackerStorageList");
  115.     listContainer.innerHTML = "";
  116.    
  117.     Object.keys(localStorage).forEach(key => {
  118.         const itemDiv = document.createElement("div");
  119.         itemDiv.className = "hackerStorageItem";
  120.        
  121.         const keyLabel = document.createElement("span");
  122.         keyLabel.textContent = "🔑 " + key;
  123.        
  124.         const preview = document.createElement("div");
  125.         preview.className = "hackerPreview";
  126.         preview.textContent = localStorage.getItem(key).substring(0, 30) + (localStorage.getItem(key).length > 30 ? "..." : "");
  127.        
  128.         itemDiv.appendChild(keyLabel);
  129.         itemDiv.appendChild(preview);
  130.         itemDiv.onclick = () => editHackerKey(key);
  131.        
  132.         listContainer.appendChild(itemDiv);
  133.     });
  134. }
  135.  
  136. function editHackerKey(key) {
  137.     document.getElementById("hackerEditKey").textContent = `Editing: ${key}`;
  138.     document.getElementById("hackerEditValue").value = localStorage.getItem(key);
  139.    
  140.     document.getElementById("hackerApplyEdit").onclick = () => {
  141.         localStorage.setItem(key, document.getElementById("hackerEditValue").value);
  142.         updateHackerStorageList();
  143.         hackerEditPopup.style.display = "none";
  144.     };
  145.    
  146.     hackerEditPopup.style.display = "block";
  147. }
  148.  
  149. document.addEventListener("keydown", (event) => {
  150.     if (event.ctrlKey && event.shiftKey && event.key.toLowerCase() === "h") {
  151.         hackerPopup.style.display = hackerPopup.style.display === "none" ? "block" : "none";
  152.         updateHackerStorageList();
  153.         console.log("ACCESS GRANTED: LocalStorage Viewer Engaged...");
  154.     }
  155. });
  156.  
  157. document.getElementById("hackerClosePopup").onclick = () => {
  158.     hackerPopup.style.display = "none";
  159. };
  160.  
  161. document.getElementById("hackerCloseEditPopup").onclick = () => {
  162.     hackerEditPopup.style.display = "none";
  163. };
  164.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement