Skip to content

Commit

Permalink
[injectors/mv3] fix localStorage undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ioj4 committed Jul 16, 2024
1 parent b7d2675 commit 2e3ddb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion injectors/mv3/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Shelter MV3 Inj",
"version": "1.2",
"version": "1.3",
"homepage_url": "https://github.com/uwu/shelter",
"description": "Injects shelter on discord.com/app - for MV3 browsers",
"manifest_version": 3,
Expand Down
7 changes: 5 additions & 2 deletions injectors/mv3/shelter-loader.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const SHELTER_URL = "https://raw.githubusercontent.com/uwu/shelter-builds/main/shelter.js";

// discord removes localStorage later, so hold onto it
const localStorage = window.localStorage;
// discord removes localStorage from window so we get it through an iframe
const iframe = document.createElement("iframe");
iframe.style.display = "none";
document.documentElement.append(iframe);
const { localStorage } = iframe.contentWindow;

async function fetchShelter() {
const shelter = await (await fetch(SHELTER_URL)).text();
Expand Down

0 comments on commit 2e3ddb6

Please sign in to comment.