@@ -1415,7 +1415,6 @@ function getParameterByName(name) {
1415
1415
* the input field for the confirm email verification process.
1416
1416
*/
1417
1417
function populateActionCodes ( ) {
1418
- return ;
1419
1418
let emailForSignIn = null ;
1420
1419
let signInTime = 0 ;
1421
1420
if ( 'localStorage' in window && window [ 'localStorage' ] !== null ) {
@@ -1732,45 +1731,45 @@ function initApp() {
1732
1731
}
1733
1732
1734
1733
// Install servicerWorker if supported.
1735
- // if ('serviceWorker' in navigator) {
1736
- // navigator.serviceWorker
1737
- // .register('/service-worker.js')
1738
- // .then(reg => {
1739
- // // Registration worked.
1740
- // console.log('Registration succeeded. Scope is ' + reg.scope);
1741
- // })
1742
- // .catch(error => {
1743
- // // Registration failed.
1744
- // console.log('Registration failed with ' + error.message);
1745
- // });
1746
- // }
1747
-
1748
- // if (window.Worker) {
1749
- // webWorker = new Worker('/web-worker.js');
1750
- // /**
1751
- // * Handles the incoming message from the web worker.
1752
- // * @param {!Object } e The message event received.
1753
- // */
1754
- // webWorker.onmessage = function (e) {
1755
- // console.log('User data passed through web worker: ', e.data);
1756
- // switch (e.data.type) {
1757
- // case 'GET_USER_INFO':
1758
- // alertSuccess(
1759
- // 'User data passed through web worker: ' + JSON.stringify(e.data)
1760
- // );
1761
- // break;
1762
- // case 'RUN_TESTS':
1763
- // if (e.data.status === 'success') {
1764
- // alertSuccess('Web worker tests ran successfully!');
1765
- // } else {
1766
- // alertError('Error: ' + JSON.stringify(e.data.error));
1767
- // }
1768
- // break;
1769
- // default:
1770
- // return;
1771
- // }
1772
- // };
1773
- // }
1734
+ if ( 'serviceWorker' in navigator ) {
1735
+ navigator . serviceWorker
1736
+ . register ( '/service-worker.js' )
1737
+ . then ( reg => {
1738
+ // Registration worked.
1739
+ console . log ( 'Registration succeeded. Scope is ' + reg . scope ) ;
1740
+ } )
1741
+ . catch ( error => {
1742
+ // Registration failed.
1743
+ console . log ( 'Registration failed with ' + error . message ) ;
1744
+ } ) ;
1745
+ }
1746
+
1747
+ if ( window . Worker ) {
1748
+ webWorker = new Worker ( '/web-worker.js' ) ;
1749
+ /**
1750
+ * Handles the incoming message from the web worker.
1751
+ * @param {!Object } e The message event received.
1752
+ */
1753
+ webWorker . onmessage = function ( e ) {
1754
+ console . log ( 'User data passed through web worker: ' , e . data ) ;
1755
+ switch ( e . data . type ) {
1756
+ case 'GET_USER_INFO' :
1757
+ alertSuccess (
1758
+ 'User data passed through web worker: ' + JSON . stringify ( e . data )
1759
+ ) ;
1760
+ break ;
1761
+ case 'RUN_TESTS' :
1762
+ if ( e . data . status === 'success' ) {
1763
+ alertSuccess ( 'Web worker tests ran successfully!' ) ;
1764
+ } else {
1765
+ alertError ( 'Error: ' + JSON . stringify ( e . data . error ) ) ;
1766
+ }
1767
+ break ;
1768
+ default :
1769
+ return ;
1770
+ }
1771
+ } ;
1772
+ }
1774
1773
1775
1774
/**
1776
1775
* Asks the web worker, if supported in current browser, to return the user info
0 commit comments