Forum Discussion
Using Dev Tools with Storyline
Howdy, I am trying to determine what the storyline variables using Dev Tools. I have tried var player = GetPlayer(); and I get an error "GetPlayer is not defined". I try window.GetPlayer(); and I get "window.GetPlayer is not a function". I have javascript working fine inside storyline but just want to pull variables at different times in course and don't want to add debug text in the course. I have a course that opens another storyline course and when I use Dev Tools on the other course and the window.GetPlayer() works perfect. Why can I not connect with the parent course?
What am I doing wrong. Please help.
Hi Tracy - it's possible that your DevTools console "JavaScript context" is in the wrong window.
At the top of most Consoles, there's a dropdown where you can select the context of the window you want to interact with, and especially when working with embeds, sometimes you have to manually switch to the window containing your project (look for story.html).
Typically, if you right-click > Inspect pages the console will take you to the proper context. But since most of the Storyline stage disables right-click, you often have to manually select it; either through the dropdown, or the element inspector where you can then select your Storyline stage which switches to that context.
This may not be the issue, but it's a common one for me.
- MathNotermans-9Community Member
Do share a sample. Easier to debug.
- TracyCowanCommunity Member
I have a scorm cloud version: https://app.cloud.scorm.com/sc/InvitationConfirmEmail?publicInvitationId=1fac1d1b-0560-4723-ab15-6a7d866c0e46
My goal for this course is to use local storage variables to update storyline variables so I can bookmark where in the module someone closes the browser. course1 published files are placed in the story_content folder of the bookmark published output.
- MatthewKliewerCommunity Member
Hi Tracy - it's possible that your DevTools console "JavaScript context" is in the wrong window.
At the top of most Consoles, there's a dropdown where you can select the context of the window you want to interact with, and especially when working with embeds, sometimes you have to manually switch to the window containing your project (look for story.html).
Typically, if you right-click > Inspect pages the console will take you to the proper context. But since most of the Storyline stage disables right-click, you often have to manually select it; either through the dropdown, or the element inspector where you can then select your Storyline stage which switches to that context.
This may not be the issue, but it's a common one for me.
- TracyCowanCommunity Member
Thank you so much. That worked. I was in the wrong window.
- CraigHaddenCommunity Member
Thanks for posting this, Matthew. I'm delving into JS more with current my project, but I don't see any mention of story.html in the dropdown. Please can you point me in the right direction?
- MatthewKliewerCommunity Member
Hi Craig - it looks like you might have opened the DevTools from a different tab/window than the one that's currently running the Storyline course?
You might check that you didn't hit F12 too early (something that can happen if you're using an LMS that pops open a new window, and you hit F12 while the underlying LMS window is active instead of the new popup containing the course).
- TracyCowanCommunity Member
Howdy, here is another way to get dev tools to work. click the circled icon (element inspector) in image below and click on your content in the browser.