Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved]Refused to execute script because it's MIME type is not executable
Go
New
Search
Notify
Tools
Reply
  
[Solved]Refused to execute script because it's MIME type is not executable
 Login/Join
 
Gold member
posted
Hi,

We are migrating from Webfocus 8010 to Webfocus 8204. We have certain fex files which are being called within an HTML. These fex files have JS embedded in it and it is failing to execute. Here's an example, below script(checkaccess.fex) is setting the value of variable check. This fex is being called within the html page and the value of check is being referred in another JS inside the HTML page. But it fails to run with the error:
"run.bip?BIP_REQUEST_TYPE=BIP_LAUNCH&BIP_folder=IBFS%3A%2FWFC%2FRepository%2FOPERA%2FStaffing_Analysis_Suite%2F&BIP_item=flexibility_index.htm:1 Refused to execute script from '*****************BIP_item=CheckAccess.fex' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled."

 -SET &ECHO =  ALL

-IF &&EXTRASALLOWED CONTAINS 'StaffingAnalysis' THEN GOTO ACCESS; 

-NOACCESS

-HTMLFORM BEGIN

        var check = 'NO';

-HTMLFORM END

-GOTO DONE

-ACCESS


-HTMLFORM BEGIN

        var check = 'YES';

-HTMLFORM END




-DONE 


The difference I notice between the 8010 version and 8204 version is in the response headers.

I am getting "X-Content-Type-Options: nosniff"
in the 8204 version and I believe this is causing the issue. However, i have not been able to find where this is being set. We are ussing IIS10 for SSO, Tomcat 8 and Webfocus 8204.

This message has been edited. Last edited by: Kartik Katyal,


WebFOCUS 8010,8204
Windows
 
Posts: 52 | Registered: June 26, 2015Reply With QuoteReport This Post
Expert
posted Hide Post
I think I would open a case with TechSupport on this one.

Although I have seen the mime type issue before somewhere.

How are you running the CheckAccess.fex ?

Can you post a snippet of code ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6136 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Gold member
posted Hide Post
Calling it withing the script tag in our html and then utilising the output in a JS function.
 <script src="/ibi_apps/run.bip?BIP_REQUEST_TYPE=BIP_LAUNCH&BIP_folder=IBFS%253A%252FWFC%252FRepository%252FOPERA%252FStaffing_Analysis_Suite&BIP_item=CheckAccess.fex"></script>


<script type="text/javascript">

function checkaccess()

{

        if (check == 'NO')
        {
                window.location.href = "/ibi_apps/run.bip?BIP_REQUEST_TYPE=BIP_LAUNCH&BIP_folder=IBFS%253A%252FWFC%252FRepository%252FOPERA%252FCommon_Replicated_Objects&BIP_item=No_Access_page.htm";
        }

}
</script> 


WebFOCUS 8010,8204
Windows
 
Posts: 52 | Registered: June 26, 2015Reply With QuoteReport This Post
Expert
posted Hide Post
Try adding type="text/javascript" to your call.

e.g.
<script type="text/javascript"...


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6136 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Gold member
posted Hide Post
Tried already but that didn't help. It kept giving the same error message.


WebFOCUS 8010,8204
Windows
 
Posts: 52 | Registered: June 26, 2015Reply With QuoteReport This Post
Gold member
posted Hide Post
I think it is validating the type with the actual extension of the file that are being called, because it doesn't error out for the .js files.

Also it doesn't error out if I give the fex files an extension of "text/plain" but then it doesn't resolve var check = "Yes" as javascript.

Wonder if it's something in the redirection settings that needs to be changed.


WebFOCUS 8010,8204
Windows
 
Posts: 52 | Registered: June 26, 2015Reply With QuoteReport This Post
Expert
posted Hide Post
What browser are you having the issue on ?

I was going to suggest adding "SET HTMLFORMTYPE = JS" to your fex.

This will remove any comments/execution run text from the returned text.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6136 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Gold member
posted Hide Post
That worked.

Thanks!!


WebFOCUS 8010,8204
Windows
 
Posts: 52 | Registered: June 26, 2015Reply With QuoteReport This Post
Expert
posted Hide Post
That OK

A bit surprised, as I could not replicate here.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6136 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved]Refused to execute script because it's MIME type is not executable

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.