If Replit isn’t going to release Mass Download yet, I’m going to do it for them.
Use these bookmarklets (javascript code in the form of a bookmark) as minor functionality patches before Mass Download gets released.
EDIT: Use devtools if problematic (remove the javascript: part part before using)
Mass download selected files
javascript: let popup = document.querySelector(".css-p60fys"); if (! popup){alert("Please select at least 1 repl(s) before using this tool.");} else{let btndiv = popup.children[1].children[0]; console.log(btndiv.children[0].innerHTML); btndiv.innerHTML = `<button onclick='let pickedRepls = []; document.querySelectorAll(".css-ow5df0").forEach(function(e, i){let selected = e.children[0].children[0].children[0].children[0].children[0].children[0].checked; console.log(selected); if (selected){pickedRepls.push(i)}}); console.log(pickedRepls); document.querySelectorAll(".css-1nj74pm")[1].click(); document.querySelectorAll(".css-ow5df0").forEach(function(e, i){if (pickedRepls.includes(i)){console.log(e); window.open(e.children[0].href + ".zip")}});' class="replStar css-1nj74pm" type="button" aria-label="Star" style="--height: 24px; --width: 24px;"><img src="data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' height='16' viewBox='0 -960 960 960' width='16'%3e%3cpath fill='%23FFFFFF' d='M480-313 287-506l43-43 120 120v-371h60v371l120-120 43 43-193 193ZM220-160q-24 0-42-18t-18-42v-143h60v143h520v-143h60v143q0 24-18 42t-42 18H220Z'/%3e%3c/svg%3e"/></button>`}
Add individual download button to repls
javascript: document.querySelectorAll(".css-ow5df0").forEach(function(e){console.log(e); e.children[1].children[0].innerHTML = `<button onclick="window.open('${e.children[0].href}.zip'); window.focus();" class="replStar css-hc192a" type="button" aria-label="Star" style="--height: 24px; --width: 24px;"><img src="data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' height='16' viewBox='0 -960 960 960' width='16'%3e%3cpath fill='%23FFFFFF' d='M480-313 287-506l43-43 120 120v-371h60v371l120-120 43 43-193 193ZM220-160q-24 0-42-18t-18-42v-143h60v143h520v-143h60v143q0 24-18 42t-42 18H220Z'/%3e%3c/svg%3e"/></button>`;})
How to use bookmarklets
copy one of the above code snippets (including javascript:
!! ).
Find your bookmark bar (press CTRL - SHIFT - B )
Create a new bookmark.
3a. Set the title to anything you want
3b. Set the URL/link to the code snippet you copied earlier (make sure that your code snippet starts with javascript:
)
Save
Go to replit.com
5a. If you are using Mass Download
, select a few repls first.
Click on your newly created bookmark to activate the download tool
For Individual download
, you will find a download button where the “Star Repl” button used to be.
For Mass download
, you fill find a download button which replaces the “Delete” button.
4 Likes
Tell me if there are any bugs, I’ll gladly fix them.
1 Like
The one that adds the download buttons uses an incorrect icon, renders as a broken/unloaded image.
Image src: data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' height='16' viewBox='0 -960 960 960' width='16'><path fill='#FFFFFF' d='M480-313 287-506l43-43 120 120v-371h60v371l120-120 43 43-193 193ZM220-160q-24 0-42-18t-18-42v-143h60v143h520v-143h60v143q0 24-18 42t-42 18H220Z'/></svg>
2 Likes
ah, encoding? let me try again.
This does not work if I am in a folder. I went into my folder and wanted to download everything in it. So, I selected everything in the folder (manually, of course) and hit the bookmarklet and got this:
2 Likes
I haven’t tested it yet, it worked in the root directory, so I’ll have to debug later today. What browser are you using?
@Firepup650 It works for me, try using devtools.
Let me upload it again.
Mass delete tool:
let popup = document.querySelector(".css-p60fys"); if (! popup){alert("Please select at least 1 repl(s) before using this tool.");} else{let btndiv = popup.children[1].children[0]; console.log(btndiv.children[0].innerHTML); btndiv.innerHTML = `<button onclick='let pickedRepls = []; document.querySelectorAll(".css-ow5df0").forEach(function(e, i){let selected = e.children[0].children[0].children[0].children[0].children[0].children[0].checked; console.log(selected); if (selected){pickedRepls.push(i)}}); console.log(pickedRepls); document.querySelectorAll(".css-1nj74pm")[1].click(); document.querySelectorAll(".css-ow5df0").forEach(function(e, i){if (pickedRepls.includes(i)){console.log(e); window.open(e.children[0].href + ".zip")}});' class="replStar css-1nj74pm" type="button" aria-label="Star" style="--height: 24px; --width: 24px;"><img src="data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' height='16' viewBox='0 -960 960 960' width='16'%3e%3cpath fill='%23FFFFFF' d='M480-313 287-506l43-43 120 120v-371h60v371l120-120 43 43-193 193ZM220-160q-24 0-42-18t-18-42v-143h60v143h520v-143h60v143q0 24-18 42t-42 18H220Z'/%3e%3c/svg%3e"/></button>`}
Umm…
It works perfectly though (the folders might not work but don’t ask me I don’t use folders)
And I how do I restore my star button??
(why does it have to replace the star button? Can’t you make a new button?)
(YOU OWE ME A STAR BUTTON )
Just reload the page
I just dont want to deal with CSS of the relplit UI, and it’s easier to replace than to create.
1 Like
That was what I meant when I said that the image became broken. I didn’t try mass-delete though.
1 Like
I got the same result as CoderElijah even in my root directory:
Weird that it would fail as a bookmarklet instead of console, but it does appear to almost execute correctly via devtools, but it opens links to undefined Repl downloads, and this is logged to console:
[Report Only] Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present.
On the other hand, individual downloads seem fine when run from console.
3 Likes
I am using FireFox browser.
python660:
Mass download selected files
I get this error when I run it in the console:
Uncaught SyntaxError: Lexical declaration cannot appear in a single-statement context
Edit: nevermind, it was because I didn’t remove the javascript:
. (if anybody else gets that problem)
But now it is opening undefined…I’ve been looking into it for the past 30min so i’ll let you know if i figure it out
1 Like
Hmm… maybe the x buttom takes some time to execute
Ill fix it maybe soon
2 Likes
Okay so…it seems now that it’s not selecting the right anchor tag, but when I look at the href value of the correct one then it’s just ''
so I’m confused
Well try adding a delay after the .click command, because when selecting repls, the repl div becomes non-linked (to allow selecting)
Im on a phone so no easy access to devtools
1 Like
Right okay I think that happened cuz I removed the X button so it was in selecting mode still… ill try a delay
1 Like
Yeah that’s it. It’s cuz it doesn’t X out the bulk select tool fast enough.
Here’s a working version of the mass download
javascript: let popup = document.querySelector(".css-p60fys"); if (! popup){alert("Please select at least 1 repl(s) before using this tool.");} else{let btndiv = popup.children[1].children[0]; console.log(btndiv.children[0].innerHTML); btndiv.innerHTML = `<button onclick='let pickedRepls = []; document.querySelectorAll(".css-ow5df0").forEach(function(e, i){let selected = e.children[0].children[0].children[0].children[0].children[0].children[0].checked; console.log(selected); if (selected){pickedRepls.push(i)}}); console.log(pickedRepls); document.querySelectorAll(".css-1nj74pm")[1].click();setTimeout(function(){document.querySelectorAll(".css-ow5df0").forEach(function(e, i){if (pickedRepls.includes(i)){console.log(e); window.open(e.children[0].href + ".zip")}});},500)' class="replStar css-1nj74pm" type="button" aria-label="Star" style="--height: 24px; --width: 24px;"><img src="data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' height='16' viewBox='0 -960 960 960' width='16'%3e%3cpath fill='%23FFFFFF' d='M480-313 287-506l43-43 120 120v-371h60v371l120-120 43 43-193 193ZM220-160q-24 0-42-18t-18-42v-143h60v143h520v-143h60v143q0 24-18 42t-42 18H220Z'/%3e%3c/svg%3e"/></button>`}
(Edit: well still seems to not work as a bookmarklet, but still works in devtools!
2 Likes