Created
January 30, 2020 22:22
-
-
Save davidawad/6a528429d237ad648f34c9a29207854a to your computer and use it in GitHub Desktop.
fixing Grammarly to work automatically within chrome or any js page
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
var SELECTOR = "grammarly-card div div div div div div div div"; | |
function grammarCorrection(){ | |
// find the grammarly div and click within the menu to correct | |
var evt = new MouseEvent("click"); | |
g = $("grammarly-card div div div div div div div div")[1]; | |
g.dispatchEvent(evt); | |
} | |
checkErrors (){ | |
// nothing to find | |
if (typeof undefined === typeof $(SELECTOR)[1]){ | |
return; | |
} | |
// click the damn thing | |
grammarCorrection(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment