5

My webapp uses YUI library exactly as recommended in the doc:

<script src="http://yui.yahooapis.com/3.18.1/build/yui/yui-min.js"></script>

PROBLEM: Modern browsers do not load it anymore, citing mixed HTTPS/HTTP concerns.

Replacing http with https in the URL above does not work (they have a certificate problem).

Copying yui-min.js to my HTTPS domain does not work either, because the JavaScript seems to contain its own URL within its minified source code, for instance here:

[...] var p,b,q="3.4.1",h=".",n="http://yui.yahooapis.com/",t= [...]

I tried modifying the variable above directly in the minified code, but that broke things as now YUI for some reason tries to load https://myserver/combo, which obviously does not exist.

QUESTION: What is the right way to switch the YUI library to HTTPS?

http://blog.andrewbruce.net/why-is-serving-yui3-over-https-so-hard describes this problem as "one of the most frustrating development problems I’ve come across in my career", and describe how 3 techniques failed, and how he resorted to perform network sniffing and identify traffic for each browser he wanted to support. I would like to avoid this as I can not test on all browsers.

A recent glimmer of hope is the appearance of https://yui-s.yahooapis.com/combo?2.6.0/build/animation/animation-min.js which might lead to a usable HTTPS/YUI without having to go through much trouble.

Similar old question, but sole answer is based on YUI Configurator, which has been deprecated and is now unavailable.

Community
  • 1
  • 1
Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
  • 1
    possible duplicate of [What is the "right" way to use YUI3 with HTTPS?](http://stackoverflow.com/questions/14267371/what-is-the-right-way-to-use-yui3-with-https) – franciscod Jul 15 '15 at 07:17
  • @franciscod: No, the answer there is out-of-date, as [the YUI Configurator has been deprecated](http://yuilibrary.com/yui/configurator/) – Nicolas Raoul Jul 15 '15 at 09:11
  • 1
    [New answer](http://stackoverflow.com/a/42864665/4628327) at that question; changing the base URL from `http://yui.yahooapis.com/` to `https://yui-s.yahooapis.com/` seems to work. (_Whew!_) – Ralph J Apr 03 '17 at 16:30
  • I use the Version 3.17.2. I localized the yui-min.js to my server and replaced http://yui.yahooapis.com/ with https://yui-s.yahooapis.com in it. This just worked! – Martin Krung Aug 21 '18 at 21:50

0 Answers0