Solved

IE Secure Unsecure content warning with Flash file

Posted on 2007-03-29
4
1,152 Views
Last Modified: 2012-08-13
Haven't had any luck so far with this question in the IE Security area, so thought I would try asking here...

I am posting content on a secure site (our LMS), and am having problems with the IE "This page contains secure and unsecure elements".  The last page of my course has a "launch test" button, and when they click on it the LMS closes the course content window and opens the test window, which is just a Flash file created using Captivate.  Big problem is that the IE security error pops up behind the Flash content test page, and will really confuse people.  I have tried to make all the links to the Flash stuff https instead of http, but it is still coming up.  The warning usually appears twice - once after the button is pushed on the course page, and then again just before the final content of the flash file is loaded (i.e. it loads almost to completion and the warning appears again).  It will be long, but I am going to post the entire code for the page to see if someone can tell me what I am missing to cause this error.  Super time critical - so quick help would be hugely appreciated.

Ugh - code looks ugly, but it's late...can't clean it up...hope you can wade through it!!

--------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
      <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <title>TestOnline_NonMM_V2</title>
            <script src="standard.js" type="text/javascript"></script>
            <script src="SCORM_support/scorm_support.js"></script>
            <script type="text/javascript" language="JavaScript">
                  // Updated version March 26 with codebase changed to https
                  // set document.domain property here, if it works for your environment/SCORM implementation
                  // document.domain="";
                  var g_intAPIType = 0;
                  // Hook for Internet Explorer
                  if ((navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) || g_intAPIType == -1)
                  {
                        g_intAPIType = 0;
                        document.write('<script language=\"VBScript\"\>\n');
                        document.write('On Error Resume Next\n');
                        document.write('Sub Captivate_FSCommand(ByVal command, ByVal args)\n');
                        document.write('Call Captivate_DoFSCommand(command, args)\n');
                        document.write('End Sub\n');
                        document.write('</script\>\n');
                  } else {
                        g_intAPIType = 1;
                  }
                  var strURLFile = "TestOnline_NonMM_V2.swf";                  // Name of the flash file
                  var intIntervalSecs = 1;                        // Number of seconds to wait for SCORM API to load
                  var g_intAPIOrder = 0;                              // Way to search for API object (0 - starts with bottom up; 1 - starts top down)
                  var strURLBase = "";
                  var strURLParams = "";
                  var strURLFull = document.location + "";
                  var intTemp = strURLFull.indexOf("#");
                  if (intTemp == -1)
                        intTemp = strURLFull.indexOf("?");
                  if (intTemp > 0)
                        strURLParams = strURLFull.substring(intTemp + 1, strURLFull.length);
                  var strTemp = location.protocol.toUpperCase();
                  if (strTemp.indexOf("FILE") == -1)
                    var intTemp = location.pathname.lastIndexOf("/");
                  else
                    var intTemp = location.pathname.lastIndexOf("\\");
                  if (intTemp != -1)
                    strURLBase = location.protocol + "//" + location.host + location.pathname.substring(0, intTemp + 1);
                  else
                    strURLBase = location.protocol + "//" + location.host + location.pathname;

                  strURLParams = (strURLParams==unescape(strURLParams)?escape(strURLParams):strURLParams);
                  strURLParams = (strURLParams==""?"":"?") + strURLParams;

                  function Finish()
                  {
                        if ((isAPI()) && (g_bFinishDone == false))
                        {
                              (g_zAPIVersion=="0.2"?g_objAPI.LMSCommit(""):g_objAPI.Commit(""));
                              g_bFinishDone = (g_zAPIVersion=="0.2"?g_objAPI.LMSFinish("") == "true":g_objAPI.Terminate("") == "true");
                        }
                        return (g_bFinishDone + "" ) // Force type to string
                  }

                  if(g_intAPIType==0)
                  {
                        // Detect Internet Explorer
                        var g_bIsInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
                        // Handle fscommand messages from a Flash movie
                        function Captivate_DoFSCommand(command, args)
                        {
                              var CaptivateObj = g_bIsInternetExplorer ? Captivate : document.Captivate;

                              var strFSArgs = new String(args);
                              var strFSCmd = new String(command);
                              var strErr = "true";
                              var strFSArg1, strFSArg2, strFSArg3
                              var intFSDelimiter = strFSArgs.indexOf("|");
                              if (intFSDelimiter > -1)
                              {
                                    strFSArg1 = strFSArgs.substr(0, intFSDelimiter);       // Name of data element to get from API
                                    var strFSTemp = strFSArgs.substr(intFSDelimiter + 1);
                                    intFSDelimiter = strFSTemp.indexOf("|");
                                    if(intFSDelimiter > -1)
                                    {
                                          strFSArg2 = strFSTemp.substr(0, intFSDelimiter);      // Value
                                          strFSArg3 = strFSTemp.substr(intFSDelimiter + 1);      // Variable
                                    } else {
                                          strFSArg2 = strFSTemp;
                                    }
                              } else {
                                    strFSArg1 = strFSArgs;
                              }

                              // do nothing, if SCORM API is not available
                              if (!isAPI()) return;

                              if ( strFSCmd == "LMSInitialize" || strFSCmd=="Initialize")
                              {
                                    CaptivateObj.SetVariable(strFSArg3, eval('g_objAPI.' + strFSCmd + '(\"\");'));
                              } else if ( strFSCmd == "LMSSetValue" || strFSCmd=="SetValue") {
                                    strErr = eval('g_objAPI.' + strFSCmd + '(\"' + strFSArg1 + '\",\"' + strFSArg2 + '\");');
                                    CaptivateObj.SetVariable(strFSArg3, strErr);
                              } else if ( strFSCmd == "LMSFinish" || strFSCmd=="Terminate") {
                                    g_bFinishDone = eval('g_objAPI.' + strFSCmd + '(\"\");')
                                    strErr = g_bFinishDone;
                                    CaptivateObj.SetVariable(strFSArg3, g_bFinishDone);
                              } else if ( strFSCmd == "LMSCommit" || strFSCmd=="Commit") {
                                    strErr = eval('g_objAPI.' + strFSCmd + '(\"\");');
                                    CaptivateObj.SetVariable(strFSArg3, strErr);
                              } else if ((strFSArg2) && (strFSArg2.length > 0)) {
                                    if(strFSCmd=="LMSGetLastError")
                                    {
                                          strErr = eval('g_objAPI.' + strFSCmd + '();')
                                          CaptivateObj.SetVariable(strFSArg3, strErr);
                                    } else {
                                          strErr = eval('g_objAPI.' + strFSCmd + '(\"' + strFSArg1 + '\");')
                                          CaptivateObj.SetVariable(strFSArg3, strErr);
                                    }
                              } else if (strFSCmd.substring(0,3) == "LMSGet") {
                                    strErr = "-2: No Flash variable specified"
                              }

                              return strErr;
                        }
                  }

            </script>
      </head>
      <body bgcolor="#F5F4F1" onUnload="Finish();">
            <layer id="NS_dynamic" name="NS_dynamic">
            <script type="text/javascript">
                  <!--
                  writeDocument('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+
                        'codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"'+
                        'width="2" height="2" id="scorm_support" align="">'+
                        '<param name=movie value="SCORM_support/scorm_support.swf"> <param name=quality value=high> <param name=menu value=false> <param name=bgcolor value=#FFFFFF>'+
                        '<embed src="SCORM_support/scorm_support.swf" quality=high bgcolor=#FFFFFF  width="2" height="2" name="scorm_support" align=""'+
                              'type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer">'+
                        '</embed>'+
                        '</object>');
                  //-->
            </script>
            <noscript>
                  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                        codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
                        width="2" height="2" id="scorm_support" align="">
                        <param name=movie value="SCORM_support/scorm_support.swf"> <param name=quality value=high> <param name=menu value=false> <param name=bgcolor value=#FFFFFF>
                        <embed src="SCORM_support/scorm_support.swf" quality=high bgcolor=#FFFFFF  width="2" height="2" name="scorm_support" align=""
                              type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer">
                        </embed>
                  </object>
            </noscript>
            </layer>
            <iframe name="IE_dynamic" height=0 width=0 src="SCORM_support/scorm_support.htm"></iframe>
            <script type="text/javascript" language="JavaScript">
                  var timeCurrent_int = new Date().getTime();
                  var timeLimit_int = new Date().getTime() + (intIntervalSecs * 1000);
                  // This simply loops for a set period of time, waiting for the API to
                  // load and/or be found.  A better solution would be to use setInterval
                  // and on the timeout, redirect or load the resulting Captivate file.
                  while((g_objAPI == null) && timeCurrent_int < timeLimit_int)
                  {
                        g_objAPI = getAPI(g_intAPIOrder);
                        timeCurrent_int = new Date().getTime();
                  }
                  if(g_objAPI != null)
                  {
                        strURLParams += (strURLParams==""?"?":"&") + "SCORM_API=" + g_zAPIVersion + "&SCORM_TYPE=" + g_intAPIType;
                  }
                 
                  document.write('<center>');
                  document.write('<table border="0" cellpadding="7" cellspacing="7"> \n');
                  document.write('  <tr>  \n');
                  document.write('    <td align="middle">');
                  writeDocument('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="Captivate" width="800" height="600" align="middle"> \n'+
                              '        <param name=movie value="' + strURLFile + strURLParams + '">\n'+
                              '        <param name=quality value=high> \n'+
                              '        <param name=loop value=0> \n'+
                              '        <embed src="' + strURLFile + strURLParams + '" pluginspage="https://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" quality=high type="application/x-shockwave-flash" name="Captivate" width="800" height="600" align="middle" swLiveConnect="true">\n'+
                              '        </embed>  \n'+
                              '</object>');
                  document.write('</td> \n');
                  document.write('  </tr> \n');
                  document.write('</table> \n');
                  document.write('</center>');

            </script>
      </body>
</html>
0
Comment
Question by:bcad
  • 2
4 Comments
 
LVL 18

Expert Comment

by:ingwa
ID: 18836313
Hi, ensure that the swf file you are calling is also contained within the secure site.  For example, oif you are calling your site from https://mysite.com then your swf should also be called within that site structure.  hope this helps.
0
 
LVL 4

Expert Comment

by:Lito1
ID: 21188841
I've never heard of this happening, but perhaps the first 2 lines of your code are triggering the warning?

I've never heard of a doctype declaration causing this, but perhaps the <html xmlns... is the culprit.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


Also I noticed you're loading an <IFrame> any content inside it that may be referenceing non secure protoco...l http:// instead of https://???
0
 
LVL 1

Author Comment

by:bcad
ID: 21191804
Thanks for posting on this Lito1 - I didn't even realize this question was still open!  I am still having this issue on our LMS, so once I get back into the office this week, I will take a look at it...
0
 
LVL 1

Accepted Solution

by:
bcad earned 0 total points
ID: 22739861
The secure/unsecure warnings were being triggered by one of the scorm support files (scormsupport.html), so once I changed the http references to https, the additional warning went away.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now