Skip to content

Instantly share code, notes, and snippets.

@davidawad
Created January 30, 2020 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidawad/6a528429d237ad648f34c9a29207854a to your computer and use it in GitHub Desktop.
Save davidawad/6a528429d237ad648f34c9a29207854a to your computer and use it in GitHub Desktop.
fixing Grammarly to work automatically within chrome or any js page
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