Fix GH-103: Create SWF regardless of platform #107

Merged
merged 1 commit into from Jan 5, 2017

Projects

None yet

3 participants

@cwillisf
Contributor
cwillisf commented Jan 4, 2017 edited

Port LLK/scratchr2#4168 for ScratchX.

Note that this change adds Bowser as a ScratchX dependency. For consistency, I used the same version that we currently use in scratchr2.

Original description from LLK/scratchr2#4168:

This fixes #4112 by creating the swf regardless of OS and browser. Calling embedSWF would first check for the existence of the plugin before creating, causing browsers that don’t allow the flash plugin by default to not be able to show their “allow” message. This tries to create the swf no matter what, allowing browsers to detect flash themselves.

Logic is as follows:

  1. check if userAgent returns a mobile/tablet OS. Display error message if so
  2. check if on windows and using ie – check for an express install if so (like in embedSWF)
  3. load the swf in all other cases, let browsers handle it.

Test Cases:

  • Test how project pages load in Android and iOS devices, on tablets and on phones, and on multiple desktop OS's for correct loading behavior.

This resolves LLK/scratchx#103

@cwillisf cwillisf Fix GH-103: Create SWF regardless of platform
Port LLK/scratchr2#4168 for ScratchX.

Original description from that change:
> This fixes #4112 by creating the swf regardless of OS and browser.
> Calling `embedSWF` would first check for the existence of the plugin
> before creating, causing browsers that don’t allow the flash plugin by
> default to not be able to show their “allow” message. This tries to
> create the swf no matter what, allowing browsers to detect flash
> themselves.
>
> Logic is as follows:
> 1. check if `userAgent` returns a mobile/tablet OS. Display error
>    message if so
> 2. check if on windows and using ie – check for an express install if
>    so (like in `embedSWF`)
> 3. load the swf in all other cases, let browsers handle it.
>
> Test Cases:
> - Test how project pages load in Android and iOS devices, on tablets
>   and on phones, and on multiple desktop OS's for correct loading
>   behavior.

This resolves LLK/scratchx#103
e2455a0
@cwillisf cwillisf added this to the January 19 milestone Jan 4, 2017
@cwillisf cwillisf requested review from rschamp and mewtaylor Jan 4, 2017
@mewtaylor

Looks great, thanks @cwillisf !

@mewtaylor mewtaylor removed their assignment Jan 4, 2017
@rschamp
rschamp approved these changes Jan 5, 2017 View changes
@rschamp rschamp removed their assignment Jan 5, 2017
@cwillisf cwillisf merged commit ce75fab into LLK:gh-pages Jan 5, 2017
@cwillisf cwillisf deleted the cwillisf:create-swf-on-all-platforms branch Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment