MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / backup

Function backup

scripts/shortenURL.js:231–264  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

229};
230
231function backup() {
232 let div = /*html*/ `<div class="container">
233 <div class="inner-container">
234 <button id="close-btn">Close</button>
235
236 </div>
237</div>
238<style>
239 .container {
240 position: fixed;
241 top:0;left:0;right:0;bottom:0;
242 background: #333e;
243 display: flex;
244 justify-content: center;
245 }
246 .inner-container {
247 position: relative;
248 background: #aaa;
249 }
250 #close-btn {
251 position: absolute;
252 top: 0; right: 0;
253 padding: 5px 10px;
254 }
255</style>`;
256
257 let child = document.createElement("div");
258 child.innerHTML = div;
259 document.body.appendChild(child);
260
261 document.querySelector("#close-btn")?.addEventListener("click", function () {
262 child.remove();
263 });
264}

Callers

nothing calls this directly

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected