pipwerks / scorm-api-wrapper

The pipwerks SCORM API Wrapper
http://pipwerks.com
357 stars 125 forks source link

Issue with Permission denied to access property 'API' #20

Closed etavener closed 8 years ago

etavener commented 9 years ago

Hi,

I'm having an issue with your SCORM_API_wrapper.js. I've installed your pipwerks.scorm component via Bower and it is located in Bower_components.

When your script calls the pipwerks.SCORM.API.find method it's throwing an error which breaks my HTML content player (course).

The error is triggered whenever a call to "window.top.opener.API" is made. The message that appears in the console is "Error: Permission denied to access property 'API' "

The really bizarre thing is that I have used this script before on another project and it works fine (in the same LMS too). The only difference is the fact it's not using it as a bower component and the main javascript is slightly different.

Do you have any idea why this is happening? Your help would be appreciated.

This happens in both Firefox and IE 11. I haven't checked it in any other browsers yet.

Please, please help me.

moloko commented 9 years ago

this isn't SuccessFactors/Plateau LMS is it by any chance?

moloko commented 9 years ago

also, if you get the same error by trying to access window.top.opener.API via the console, then the issue is not with the pipwerks code - since by using the console like that you're bypassing the pipwerks code and accessing the API directly

etavener commented 9 years ago

Hi,

I wasn't suggesting that it was your code. However, I am struggling to understand why it works in one course and not in another. If I run window.top.opener.API in the console I still get the " Permission denied to access property 'API' " message. In the other module (the one that works) I call the same line in the console and it works.

No it's not Plateau. It's a customised version of Success Factors, I think.

Thanks, Ewan Tavener

moloko commented 9 years ago

Hi Ewan Sure, it was just that since this sounds like it's not an issue with the pipwerks code you might get a better response from a more general SCORM forum such as https://groups.google.com/forum/#!forum/elearning-technology-and-development

Anyway SuccessFactors and Plateau are much the same - they're certainly owned by the same company. The reason I asked is that I came across this exact issue with a course that was running on SuccessFactors. Unfortunately I do not know what the resolution was since it was the client's LMS, I merely reported my findings to them stating that I believed the problem was at the LMS end, it seems it was because they reported back that they had fixed it at their end.

Sorry I can't be more help, like I say you might have more luck on https://groups.google.com/forum/#!forum/elearning-technology-and-development

etavener commented 9 years ago

Hi,

I've just realised there is a relationship between Plateau and Success Factors.

Are you aware of an issue with this LMS and accessing the SCORM API?

Thanks, Ewan Tavener

etavener commented 9 years ago

Thanks

pipwerks commented 9 years ago

Are you targeting SCORM 2004 or 1.2?

etavener commented 9 years ago

It's targeting SCORM 1.2

Sent from my iPhone

On 21 Jul 2015, at 16:43, Philip Hutchison notifications@github.com wrote:

Are you targeting SCORM 2004 or 1.2?

— Reply to this email directly or view it on GitHub.

pipwerks commented 9 years ago

Two thoughts:

1) If the topmost frame is being served from a different domain than the frame that invokes window.top.opener, you will encounter a cross-origin error similar to what you describe.

2) SCORM 2004 and 1.2 use a different API (API_1484_11 and API, respectively), so in theory you could get an error if you're looking for API but the LMS is only providing API_1484_11. But since you're using SCORM 1.2, this shouldn't be an issue for you.

Otherwise, I can't think of any reasons it shouldn't work.

pipwerks commented 8 years ago

Hi, I am getting the same problem, and I think it could be reason 1) above, trying to launch a scorm course stored in an Amazon S3 bucket ... so the origin of the course is different from that of the LMS. I'm new to cross origin issues, is there a simple solution? I guess it's not the CORS on the bucket, it's the other way round, the LMS must be refusing access. Sarah

Cross-domain scripting is a JavaScript limitation, not a defect of the SCORM wrapper.