Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.

[#963724] Ensure other youtube scripts don't clobber our ready events. #373

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ScottDowne
Copy link
Contributor

No description provided.

protocol = window.location.protocol === "file:" ? "http:" : "";
// Wait for the script to be loaded, then check if it's ready.
tag.addEventListener( "load", onYouTubeIframeAPIReady, false);
tag.src = protocol + "//www.youtube.com/iframe_api";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having it be http: or https:, can you just force it to https: ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

I think there was a time where it needed to work in file:// too...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you set it to https: then we don't need to worry about loading it from file:// ever.

It also means I can just close https://bugzilla.mozilla.org/show_bug.cgi?id=965045

callback();
}
} else {
setTimeout( onYouTubeIframeAPIReady, 1000 );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script file loads in about 68ms from the office, so I think it might make sense to lower this? maybe to 250ms?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants