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

Remove site-specific "hacks" #192

Open
jonathanpeppers opened this issue Jan 20, 2023 · 0 comments
Open

Remove site-specific "hacks" #192

jonathanpeppers opened this issue Jan 20, 2023 · 0 comments
Labels
up-for-grabs Anyone can work on this. Assign yourself and give it a shot!

Comments

@jonathanpeppers
Copy link
Owner

There is a lot of weird checks like:

function isCKEditor(t) {
return t.classList.contains("cke_editable");
}
function isSlateEditor(t) {
return t.hasAttribute("data-slate-editor");
}
function isWriterDuet(t) {
return location.href.includes("writerduet.com");
}
function isQuillEditor(t) {
return t.classList.contains("ql-editor");
}
function isOpenXchangeEditor(t) {
return !!t.closest("[data-app-name='io.ox/office/text']");
}
function isProseMirror(t) {
return t.classList.contains("ProseMirror");
}
function isGutenberg(t) {
return t.classList.contains("editor-rich-text__editable") || t.classList.contains("block-editor-rich-text__editable");
}
function isTrixEditor(t) {
return "trix-editor" === t.nodeName.toLowerCase();
}
function isGoogleDocsEditor(t) {
return t.classList.contains("kix-page");
}
function isLTEditor(t) {
return t.classList.contains("lt-textarea__textarea");
}
function isCodeMirror(t) {
return t.classList.contains("CodeMirror-code");
}

These appear to be hacks for specific websites or controls.

I removed one for "TinyMCE" in #191.

I think we could remove several more of these as long as Azure DevOps and GitHub continue to work. These seem to be a source of weird code none of us understands.

@jonathanpeppers jonathanpeppers added the up-for-grabs Anyone can work on this. Assign yourself and give it a shot! label Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
up-for-grabs Anyone can work on this. Assign yourself and give it a shot!
Projects
None yet
Development

No branches or pull requests

1 participant