-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Club Penguin Journey): Add support for current RoomId with Room display on Status. #9251
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: moyaimoment <[email protected]>
Signed-off-by: moyaimoment <[email protected]>
Signed-off-by: moyaimoment <[email protected]>
actualCode = ` | ||
let roomIdLabel = document.createElement("p"); | ||
roomIdLabel.setAttribute("id", "roomId"); | ||
document.head.appendChild(roomIdLabel); | ||
|
||
let repeatTimer = setInterval(function() { | ||
const roomId = window.roomId; | ||
if (roomId) { | ||
roomIdLabel.textContent = roomId; | ||
} | ||
}, 100); | ||
`, | ||
script = document.createElement("script"); | ||
script.setAttribute("id", "injectscript"); | ||
script.textContent = actualCode; | ||
(document.head || document.documentElement).appendChild(script); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably use presence.getPageVariable
rather than injecting a script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't realize that was something I could use. It works and I've implemented it, Thanks!
Signed-off-by: moyaimoment <[email protected]>
Description
I recently contacted the Club Penguin Journey staff and asked for a way to get the current roomId and they were able to add something in the for the Presence. This update adds support for getting and using these RoomIds. This is based off the old Club Penguin Rewritten presence.
If there is a better way to do it then let me know. 🤷♂️
Acknowledgements
yarn format
Screenshots
Proof showing the creation/modification is working as expected