How can I turn off the Grammarly extension while loading an Oracle Intelligent Advisor interview?

You can turn off the Grammarly extension while loading an Oracle Intelligent Advisor interview using either of the two approaches:

  • Turn off Grammarly for specific websites:

    You can turn off Grammarly on websites hosting Oracle Intelligent Advisor interviews directly in the Grammarly settings, without any code. Visit this Grammarly support article for step-by-step instructions on disabling Grammarly for specific sites.

  • Turn off Grammarly using data tags in the HTML:

    For developers, you can turn off Grammarly on specific interview input by adding a data attribute to the HTML element. If you're working with Oracle Intelligent Advisor, this is typically done via JavaScript extensions. By adding the attribute data-enable-grammarly="false" to the relevant input fields, you can prevent Grammarly from showing its interface (for example, the green Grammarly button).

Here's an example JavaScript code that shows how to add this attribute using Oracle Intelligent Advisor JS Extensions:
OraclePolicyAutomation.AddExtension({
   customInput: function (control, interview) {
       if (control.getProperty("name") == "xMyExtension") {
           return {
               mount: function (el) {
                   var myinput = document.createElement("textarea");
                   myinput.cols = "80";
                   myinput.rows = "10";
                   myinput.maxLength = "5000";
                   myinput.id = "customInput";
                   myinput.value = control.getValue();
                   myinput.setAttribute("data-enable-grammarly", false); // Disable Grammarly
                   el.appendChild(myinput);
               },
               update: function (el) {
                   var myinput = document.getElementById("customInput");
                   
                   // Check if the control is read-only to disable the text area
                   if (control.isReadOnly()) {
                       myinput.disabled = true; // Disable the text area if read-only
                   } else {
                       myinput.disabled = false; // Enable the text area if not read-only
                   }
               },
               validate: function (el) {
                   control.setValue(document.getElementById("customInput").value);
                   return true;
               },
               unmount: function (el) {
                   var customInput = document.getElementById("customInput");
                   customInput.parentNode.removeChild(customInput);
               }
           };
       }
   }
});