Skip to content
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

Misskey support #104

Merged
merged 2 commits into from
Mar 26, 2023
Merged

Misskey support #104

merged 2 commits into from
Mar 26, 2023

Conversation

austinhuang0131
Copy link
Contributor

Closes #63. There's no follow button, so only status interaction is implemented.

Known issue: it still triggers Misskey's login popup even if I do event.stopImmediatePropagation()... I'm not sure there is an easy fix.

* from which this was adapted
* @returns {Promise}
*/
function waitForElement(selector, multiple = false, timeoutDuration = 200000) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm did not we have a very similar code in the Mastodon injection code? Maybe we can generalize/have that in some common.js or so for all injection scripts?

const replyButtons = await waitForElement(SELECTOR, true);
replyButtons.forEach((button) => {
try {
if (!button.classList.contains(INJECTED_REPLY_CLASS)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rewrite it as an early return pattern to prevent that huge indentation… (the try blocks are already needed, so…)

src/content_script/misskeyInject.js Outdated Show resolved Hide resolved
src/content_script/misskeyInject.js Outdated Show resolved Hide resolved
src/content_script/misskeyInject.js Outdated Show resolved Hide resolved
Co-authored-by: rugk <rugk+git@posteo.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suppport Misskey
2 participants