Skip to content

Commit

Permalink
Merge pull request #532 from edx/mroytman/worker-origin-fix
Browse files Browse the repository at this point in the history
add createWorkers function to handle Workers with urls across origins
  • Loading branch information
MichaelRoytman committed Feb 12, 2019
2 parents 67699af + ee02aec commit 23c9443
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion edx_proctoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
from __future__ import absolute_import

# Be sure to update the version number in edx_proctoring/package.json
__version__ = '1.5.10'
__version__ = '1.5.11'

default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
7 changes: 6 additions & 1 deletion edx_proctoring/static/proctoring/js/exam_action_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,15 @@ var edx = edx || {};
});
};

function createWorker(url) {
var blob = new Blob(["importScripts('" + location.origin + url + "');"], { "type": 'application/javascript' });
var blobUrl = window.URL.createObjectURL(blob);
return new Worker(blobUrl);
}

function workerPromiseForEventNames(eventNames) {
return function() {
var proctoringBackendWorker = new Worker(edx.courseware.proctored_exam.configuredWorkerURL);
var proctoringBackendWorker = createWorker(edx.courseware.proctored_exam.configuredWorkerURL);
return new Promise(function(resolve, reject) {
var responseHandler = function(e) {
if (e.data.type === eventNames.successEventName) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@edx/edx-proctoring",
"//": "Be sure to update the version number in edx_proctoring/__init__.py",
"//": "Note that the version format is slightly different than that of the Python version when using prereleases.",
"version": "1.5.10",
"version": "1.5.11",
"main": "edx_proctoring/static/index.js",
"repository": {
"type": "git",
Expand Down

0 comments on commit 23c9443

Please sign in to comment.