-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #624 from rgantzos/main
- Loading branch information
Showing
2 changed files
with
19 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
if (window.location.href.startsWith("https://scratch.mit.edu/projects/")) { | ||
var remixButton = document.querySelector('.remix-button') | ||
var remixText = remixButton.querySelector('span'); | ||
remixText.textContent = "Steal game" | ||
} | ||
export default async function ({ feature, console }) { | ||
ScratchTools.waitForElements(".remix-button span", function(remixText) { | ||
if (feature.self.enabled) { | ||
remixText.textContent = "Steal Game"; | ||
} | ||
}); | ||
|
||
feature.addEventListener("enabled", async function () { | ||
var remixText = await document.querySelector(".remix-button span"); | ||
if (!remixText) return; | ||
remixText.textContent = "Steal Game"; | ||
}); | ||
|
||
ScratchTools.setDisable("steal-game", function () { | ||
if (window.location.href.startsWith("https://scratch.mit.edu/projects) { | ||
var remixButton = document.querySelector('.remix-button') | ||
var remixText = remixButton.querySelector('span'); | ||
remixText.textContent = "Remix" | ||
} | ||
}) | ||
feature.addEventListener("disabled", async function () { | ||
var remixText = await document.querySelector(".remix-button span"); | ||
if (!remixText) return; | ||
remixText.textContent = "Remix"; | ||
}); | ||
} |