Prevent window.opener errors from breaking JavaScript
Prevent window.opener errors from breaking JavaScript

If the window, for whatever reason, is unable to access
the referring window (e.g. due to CORS), a DOMException
would be thrown, preventing all other JS from running on
the page. This just wraps it in a try/catch block so we
don't break all the things when this inevitably happens.

Fixes CNVS-19778

test plan:
- Create course and enroll a student
- Create and publish an assignment with media upload
    submission type
- Masquerade as student
- Put link to assignment on a cross-origin website
    (for best results use a Service Cloud case)
- Follow link to the assignment and click the
    "Submit Assignment" button
- Verify the "Record/Upload Media" button opens
    the "Record/Upload Media Comment" modal dialog

Change-Id: I043f08db318c3a7cf9d39c51da1589dd342d5fe8
Reviewed-on: https://gerrit.instructure.com/65154
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <2eafa1f6bf34395b543d6ca7f438461b0774d24f@instructure.com>
QA-Review: Landon Holmstead <b4d1c6463a1591700c2e13e0c1e3c65dd54f4c60@instructure.com>
Product-Review: Josh Simpson <bfb4987b134a00f73d881fff5113b1d5fa1876bc@instructure.com>

HotChalk/canvas-lms,leftplusrightllc/canvas-lms,SwinburneOnline/canvas-lms,roxolan/canvas-lms,sfu/canvas-lms,roxolan/canvas-lms,leftplusrightllc/canvas-lms,SwinburneOnline/canvas-lms,venturehive/canvas-lms,venturehive/canvas-lms,HotChalk/canvas-lms,SwinburneOnline/canvas-lms,sfu/canvas-lms,redconfetti/canvas-lms,SwinburneOnline/canvas-lms,grahamb/canvas-lms,grahamb/canvas-lms,redconfetti/canvas-lms,HotChalk/canvas-lms,djbender/canvas-lms,sfu/canvas-lms,fronteerio/canvas-lms,grahamb/canvas-lms,leftplusrightllc/canvas-lms,fronteerio/canvas-lms,djbender/canvas-lms,sfu/canvas-lms,fronteerio/canvas-lms,sfu/canvas-lms,djbender/canvas-lms,leftplusrightllc/canvas-lms,venturehive/canvas-lms,djbender/canvas-lms,venturehive/canvas-lms,redconfetti/canvas-lms,grahamb/canvas-lms,roxolan/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,roxolan/canvas-lms,redconfetti/canvas-lms,fronteerio/canvas-lms,grahamb/canvas-lms,HotChalk/canvas-lms