cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

IE11 webApplicationInjector fails with Wro4J addons_responsive.js minified

ioana_diaconu
Member
0 Likes
755

When using the minifier in javascript.tag, in a storefront with the smartedit extension added, the app fails in IE11

 <c:choose>
     <c:when test="${wro4jEnabled}">
           <script type="text/javascript" src="${fn:escapeXml(contextPath)}/wro/all_responsive.js"></script>
           <script type="text/javascript" src="${fn:escapeXml(contextPath)}/wro/addons_responsive.js"></script>
     </c:when>

the webApplicationInjector.js gets minified too, and loading it fails in IE. This code in webApplicationInjector:

 return t.getWebappScriptElementFromDocument = function (e) {
                     if (e.currentScript) {
                         if (!(e.currentScript instanceof HTMLScriptElement))
                             throw new Error("getWebappScriptElementFromDocument() found non htlm script element");
                         return e.currentScript
                     }
                     var n = e.querySelector("script#" + t.webappScriptId);
                     if (n)
                         return n;
                     var r = e.querySelectorAll("script[src*=" + t.webappScriptName + "]");
                     if (1 !== r.length)
                         throw new Error("SmartEdit unable to load - invalid " + t.webappScriptName + " script tag");
                     return r.item(0)
                 },


as e.currentScript is not supported in IE 11 it tries to fetch:

 var n = e.querySelector("script#" + t.webappScriptId);
                      if (n)
                          return n;
                      var r = e.querySelectorAll("script[src*=" + t.webappScriptName + "]");
 
 //where
 t.webappScriptId = "smartedit-injector",
 t.webappScriptName = "webApplicationInjector",


But the script with id/name cannot be found in the src of the document, as it uses the minified version.

Any suggestions?

Accepted Solutions (0)

Answers (1)

Answers (1)

kmrrajeev
Discoverer
0 Likes

Hi ioana.diaconu,

Did you find a resolution for this defect?