Skip to content

Instantly share code, notes, and snippets.

@kamranayub
Last active March 11, 2021 19:05
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 kamranayub/191ae27ade85d19c7ec63aa1b1ebf499 to your computer and use it in GitHub Desktop.
Save kamranayub/191ae27ade85d19c7ec63aa1b1ebf499 to your computer and use it in GitHub Desktop.
Enable Grammarly on Ghost Blog Admin Editor

Watch the Installation Instructions

https://youtu.be/N5bljLQTMhc

Browser Extension

Shahed Nasser has created a Chrome extension that will let you enable Grammarly in Ghost as well!

Install Userscript

  1. Download TamperMonkey browser extension
  2. On this page, click the "Raw" button below for the JavaScript file (enable-grammarly-for-ghost.user.js)
  3. TamperMonkey should prompt you to install it!

NOTE: This matches URLs that use the default /ghost/ path to the admin dashboard. Modify @match if you need to customize that.

Limitations

  • Enables after about 2 seconds when the page is done loading
  • Doesn't seem to play well when copying to/from Grammarly's editor

References

// ==UserScript==
// @name Enable Grammarly for Ghost Blog Editor
// @namespace https://kamranicus.com
// @version 0.1.2
// @description Enables limited Grammarly support for the Ghost Blog Editor. Does not support copy/pasting to/from Grammarly very well but editing works.
// @author Kamran Ayub
// @match *://*/ghost*
// @grant none
// @updateURL https://gist.githubusercontent.com/kamranayub/191ae27ade85d19c7ec63aa1b1ebf499/raw/enable-grammarly-for-ghost.user.js
// @downloadURL https://gist.githubusercontent.com/kamranayub/191ae27ade85d19c7ec63aa1b1ebf499/raw/enable-grammarly-for-ghost.user.js
// @supportURL https://gist.github.com/kamranayub/191ae27ade85d19c7ec63aa1b1ebf499
// ==/UserScript==
(function() {
'use strict';
function enableGrammarlyEditor() {
setTimeout(() => {
const disabledGrammarlyElements = document.querySelectorAll('.__mobiledoc-editor');
disabledGrammarlyElements.forEach(el => {
el.removeAttribute("data-gramm");
});
}, 2000);
}
window.addEventListener('load', enableGrammarlyEditor);
window.addEventListener('popstate', enableGrammarlyEditor);
window.addEventListener('hashchange', enableGrammarlyEditor);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment