Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions omloader-1.4.9/Domain-Loader/omloader-v1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<body>
<script>;(function(omidGlobal) {
function q(f){f=['object'==typeof globalThis&&globalThis,f,'object'==typeof window&&window,'object'==typeof self&&self,'object'==typeof global&&global];for(var e=0;e<f.length;++e){var h=f[e];if(h&&h.Math==Math)return h}throw Error('Cannot find global object');}var r=q(this);function u(f){var e=0;return function(){return e<f.length?{done:!1,value:f[e++]}:{done:!0}}}
var v='function'==typeof Object.defineProperties?Object.defineProperty:function(f,e,h){if(f==Array.prototype||f==Object.prototype)return f;f[e]=h.value;return f};function w(f,e){if(e)a:{var h=r;f=f.split('.');for(var k=0;k<f.length-1;k++){var l=f[k];if(!(l in h))break a;h=h[l]}f=f[f.length-1];k=h[f];e=e(k);e!=k&&null!=e&&v(h,f,{configurable:!0,writable:!0,value:e})}}
w('Symbol',function(f){function e(m){if(this instanceof e)throw new TypeError('Symbol is not a constructor');return new h(k+(m||'')+'_'+l++,m)}function h(m,c){this.g=m;v(this,'description',{configurable:!0,writable:!0,value:c})}if(f)return f;h.prototype.toString=function(){return this.g};var k='jscomp_symbol_'+(1E9*Math.random()>>>0)+'_',l=0;return e});
w('Symbol.iterator',function(f){if(f)return f;f=Symbol('Symbol.iterator');for(var e='Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array'.split(' '),h=0;h<e.length;h++){var k=r[e[h]];'function'===typeof k&&'function'!=typeof k.prototype[f]&&v(k.prototype,f,{configurable:!0,writable:!0,value:function(){return z(u(this))}})}return f});function z(f){f={next:f};f[Symbol.iterator]=function(){return this};return f}
function A(f){var e='undefined'!=typeof Symbol&&Symbol.iterator&&f[Symbol.iterator];if(e)return e.call(f);if('number'==typeof f.length)return{next:u(f)};throw Error(String(f)+' is not an iterable or ArrayLike');}function B(f,e){return Object.prototype.hasOwnProperty.call(f,e)}
w('WeakMap',function(f){function e(b){this.g=(a+=Math.random()+1).toString();if(b){b=A(b);for(var d;!(d=b.next()).done;)d=d.value,this.set(d[0],d[1])}}function h(){}function k(b){var d=typeof b;return'object'===d&&null!==b||'function'===d}function l(b){if(!B(b,c)){var d=new h;v(b,c,{value:d})}}function m(b){var d=Object[b];d&&(Object[b]=function(g){if(g instanceof h)return g;Object.isExtensible(g)&&l(g);return d(g)})}if(function(){if(!f||!Object.seal)return!1;try{var b=Object.seal({}),d=Object.seal({}),
g=new f([[b,2],[d,3]]);if(2!=g.get(b)||3!=g.get(d))return!1;g.delete(b);g.set(d,4);return!g.has(b)&&4==g.get(d)}catch(n){return!1}}())return f;var c='$jscomp_hidden_'+Math.random();m('freeze');m('preventExtensions');m('seal');var a=0;e.prototype.set=function(b,d){if(!k(b))throw Error('Invalid WeakMap key');l(b);if(!B(b,c))throw Error('WeakMap key fail: '+b);b[c][this.g]=d;return this};e.prototype.get=function(b){return k(b)&&B(b,c)?b[c][this.g]:void 0};e.prototype.has=function(b){return k(b)&&B(b,
c)&&B(b[c],this.g)};e.prototype.delete=function(b){return k(b)&&B(b,c)&&B(b[c],this.g)?delete b[c][this.g]:!1};return e});
w('Map',function(f){function e(){var a={};return a.j=a.next=a.head=a}function h(a,b){var d=a.g;return z(function(){if(d){for(;d.head!=a.g;)d=d.j;for(;d.next!=d.head;)return d=d.next,{done:!1,value:b(d)};d=null}return{done:!0,value:void 0}})}function k(a,b){var d=b&&typeof b;'object'==d||'function'==d?m.has(b)?d=m.get(b):(d=''+ ++c,m.set(b,d)):d='p_'+b;var g=a.i[d];if(g&&B(a.i,d))for(a=0;a<g.length;a++){var n=g[a];if(b!==b&&n.key!==n.key||b===n.key)return{id:d,list:g,index:a,h:n}}return{id:d,list:g,
index:-1,h:void 0}}function l(a){this.i={};this.g=e();this.size=0;if(a){a=A(a);for(var b;!(b=a.next()).done;)b=b.value,this.set(b[0],b[1])}}if(function(){if(!f||'function'!=typeof f||!f.prototype.entries||'function'!=typeof Object.seal)return!1;try{var a=Object.seal({x:4}),b=new f(A([[a,'s']]));if('s'!=b.get(a)||1!=b.size||b.get({x:4})||b.set({x:4},'t')!=b||2!=b.size)return!1;var d=b.entries(),g=d.next();if(g.done||g.value[0]!=a||'s'!=g.value[1])return!1;g=d.next();return g.done||4!=g.value[0].x||
't'!=g.value[1]||!d.next().done?!1:!0}catch(n){return!1}}())return f;var m=new WeakMap;l.prototype.set=function(a,b){a=0===a?0:a;var d=k(this,a);d.list||(d.list=this.i[d.id]=[]);d.h?d.h.value=b:(d.h={next:this.g,j:this.g.j,head:this.g,key:a,value:b},d.list.push(d.h),this.g.j.next=d.h,this.g.j=d.h,this.size++);return this};l.prototype.delete=function(a){a=k(this,a);return a.h&&a.list?(a.list.splice(a.index,1),a.list.length||delete this.i[a.id],a.h.j.next=a.h.next,a.h.next.j=a.h.j,a.h.head=null,this.size--,
!0):!1};l.prototype.clear=function(){this.i={};this.g=this.g.j=e();this.size=0};l.prototype.has=function(a){return!!k(this,a).h};l.prototype.get=function(a){return(a=k(this,a).h)&&a.value};l.prototype.entries=function(){return h(this,function(a){return[a.key,a.value]})};l.prototype.keys=function(){return h(this,function(a){return a.key})};l.prototype.values=function(){return h(this,function(a){return a.value})};l.prototype.forEach=function(a,b){for(var d=this.entries(),g;!(g=d.next()).done;)g=g.value,
a.call(b,g[1],g[0],this)};l.prototype[Symbol.iterator]=l.prototype.entries;var c=0;return l});
w('Promise',function(f){function e(c){this.i=0;this.l=void 0;this.g=[];this.v=!1;var a=this.m();try{c(a.resolve,a.reject)}catch(b){a.reject(b)}}function h(){this.g=null}function k(c){return c instanceof e?c:new e(function(a){a(c)})}if(f)return f;h.prototype.i=function(c){if(null==this.g){this.g=[];var a=this;this.l(function(){a.o()})}this.g.push(c)};var l=r.setTimeout;h.prototype.l=function(c){l(c,0)};h.prototype.o=function(){for(;this.g&&this.g.length;){var c=this.g;this.g=[];for(var a=0;a<c.length;++a){var b=
c[a];c[a]=null;try{b()}catch(d){this.m(d)}}}this.g=null};h.prototype.m=function(c){this.l(function(){throw c;})};e.prototype.m=function(){function c(d){return function(g){b||(b=!0,d.call(a,g))}}var a=this,b=!1;return{resolve:c(this.C),reject:c(this.o)}};e.prototype.C=function(c){if(c===this)this.o(new TypeError('A Promise cannot resolve to itself'));else if(c instanceof e)this.F(c);else{a:switch(typeof c){case 'object':var a=null!=c;break a;case 'function':a=!0;break a;default:a=!1}a?this.B(c):this.u(c)}};
e.prototype.B=function(c){var a=void 0;try{a=c.then}catch(b){this.o(b);return}'function'==typeof a?this.G(a,c):this.u(c)};e.prototype.o=function(c){this.A(2,c)};e.prototype.u=function(c){this.A(1,c)};e.prototype.A=function(c,a){if(0!=this.i)throw Error('Cannot settle('+c+', '+a+'): Promise already settled in state'+this.i);this.i=c;this.l=a;2===this.i&&this.D();this.H()};e.prototype.D=function(){var c=this;l(function(){if(c.I()){var a=r.console;'undefined'!==typeof a&&a.error(c.l)}},1)};e.prototype.I=
function(){if(this.v)return!1;var c=r.CustomEvent,a=r.Event,b=r.dispatchEvent;if('undefined'===typeof b)return!0;'function'===typeof c?c=new c('unhandledrejection',{cancelable:!0}):'function'===typeof a?c=new a('unhandledrejection',{cancelable:!0}):(c=r.document.createEvent('CustomEvent'),c.initCustomEvent('unhandledrejection',!1,!0,c));c.promise=this;c.reason=this.l;return b(c)};e.prototype.H=function(){if(null!=this.g){for(var c=0;c<this.g.length;++c)m.i(this.g[c]);this.g=null}};var m=new h;e.prototype.F=
function(c){var a=this.m();c.s(a.resolve,a.reject)};e.prototype.G=function(c,a){var b=this.m();try{c.call(a,b.resolve,b.reject)}catch(d){b.reject(d)}};e.prototype.then=function(c,a){function b(p,t){return'function'==typeof p?function(x){try{d(p(x))}catch(y){g(y)}}:t}var d,g,n=new e(function(p,t){d=p;g=t});this.s(b(c,d),b(a,g));return n};e.prototype.catch=function(c){return this.then(void 0,c)};e.prototype.s=function(c,a){function b(){switch(d.i){case 1:c(d.l);break;case 2:a(d.l);break;default:throw Error('Unexpected state: '+
d.i);}}var d=this;null==this.g?m.i(b):this.g.push(b);this.v=!0};e.resolve=k;e.reject=function(c){return new e(function(a,b){b(c)})};e.race=function(c){return new e(function(a,b){for(var d=A(c),g=d.next();!g.done;g=d.next())k(g.value).s(a,b)})};e.all=function(c){var a=A(c),b=a.next();return b.done?k([]):new e(function(d,g){function n(x){return function(y){p[x]=y;t--;0==t&&d(p)}}var p=[],t=0;do p.push(void 0),t++,k(b.value).s(n(p.length-1),g),b=a.next();while(!b.done)})};return e});function C(){var f=document.location.hash,e=f.indexOf('#');f=(0<=e?f.substring(e+1):'').split('&').filter(function(h){return 0<h.length}).map(function(h){return h.split('=',2).map(function(k){return decodeURIComponent(k)})});return new Map(f)}
function D(f){var e=document.createElement('script');e.src=f;e.type='text/javascript';new Promise(function(h,k){e.onload=function(){return h()};e.onerror=function(){return k(Error('Verification script URL failed to load.'))};document.getElementsByTagName('body')[0].appendChild(e)})}
document.addEventListener('DOMContentLoaded',function(){var f=C(),e=f.get('injectionId');f=f.get('verificationScriptUrl');if(!e)throw Error('Injection ID not provided.');if(!f)throw Error('Verification script URL not provided.');window.omidVerificationProperties={serviceWindow:window.parent,injectionSource:'web',injectionId:e};D(f)});
}).call(this, this);</script>
</body>
</html>
11 changes: 6 additions & 5 deletions reference-app-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ A sample web application built to showcase a canonical OM SDK for Web integratio
[nvm] is recommended for installing and managing Node and NPM.

## Getting Started
1. Install dependencies with `npm install`
1. Copy the dependencies into `static/`:
cd reference-app-web
1. Install dependencies with `npm install` or `npm install --legacy-peer-deps` if you have installed npm in your root directory
2. Copy the dependencies into `static/`: (ALREADY DONE FOR YOU)
- If in SDKJS repo: Run `npm run buildDeps`
- If in JSClients repo:
- If in JSClients repo:
- Copy the OM SDK for Web into `./static/omweb-v1.js`
- Copy the OM Domain Loader into `./static/.well-known/omid/omloader-v1.html`
- Copy the Validation Verification Script into `./static/omid-validation-verification-script-v1.js`
1. Run the dev server by running `npm run start`
1. Open http://localhost:8080 in a browser
3. Run the dev server by running `npm run start`
4. Open http://localhost:8080 in a browser

## Advanced
If you'd like to specify your own default settings, override the values in `./templates/.settings.default.json`.
Expand Down
28 changes: 28 additions & 0 deletions reference-app-web/static/.well-known/omid/omloader-v1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<body>
<script>;(function(omidGlobal) {
function q(f){f=['object'==typeof globalThis&&globalThis,f,'object'==typeof window&&window,'object'==typeof self&&self,'object'==typeof global&&global];for(var e=0;e<f.length;++e){var h=f[e];if(h&&h.Math==Math)return h}throw Error('Cannot find global object');}var r=q(this);function u(f){var e=0;return function(){return e<f.length?{done:!1,value:f[e++]}:{done:!0}}}
var v='function'==typeof Object.defineProperties?Object.defineProperty:function(f,e,h){if(f==Array.prototype||f==Object.prototype)return f;f[e]=h.value;return f};function w(f,e){if(e)a:{var h=r;f=f.split('.');for(var k=0;k<f.length-1;k++){var l=f[k];if(!(l in h))break a;h=h[l]}f=f[f.length-1];k=h[f];e=e(k);e!=k&&null!=e&&v(h,f,{configurable:!0,writable:!0,value:e})}}
w('Symbol',function(f){function e(m){if(this instanceof e)throw new TypeError('Symbol is not a constructor');return new h(k+(m||'')+'_'+l++,m)}function h(m,c){this.g=m;v(this,'description',{configurable:!0,writable:!0,value:c})}if(f)return f;h.prototype.toString=function(){return this.g};var k='jscomp_symbol_'+(1E9*Math.random()>>>0)+'_',l=0;return e});
w('Symbol.iterator',function(f){if(f)return f;f=Symbol('Symbol.iterator');for(var e='Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array'.split(' '),h=0;h<e.length;h++){var k=r[e[h]];'function'===typeof k&&'function'!=typeof k.prototype[f]&&v(k.prototype,f,{configurable:!0,writable:!0,value:function(){return z(u(this))}})}return f});function z(f){f={next:f};f[Symbol.iterator]=function(){return this};return f}
function A(f){var e='undefined'!=typeof Symbol&&Symbol.iterator&&f[Symbol.iterator];if(e)return e.call(f);if('number'==typeof f.length)return{next:u(f)};throw Error(String(f)+' is not an iterable or ArrayLike');}function B(f,e){return Object.prototype.hasOwnProperty.call(f,e)}
w('WeakMap',function(f){function e(b){this.g=(a+=Math.random()+1).toString();if(b){b=A(b);for(var d;!(d=b.next()).done;)d=d.value,this.set(d[0],d[1])}}function h(){}function k(b){var d=typeof b;return'object'===d&&null!==b||'function'===d}function l(b){if(!B(b,c)){var d=new h;v(b,c,{value:d})}}function m(b){var d=Object[b];d&&(Object[b]=function(g){if(g instanceof h)return g;Object.isExtensible(g)&&l(g);return d(g)})}if(function(){if(!f||!Object.seal)return!1;try{var b=Object.seal({}),d=Object.seal({}),
g=new f([[b,2],[d,3]]);if(2!=g.get(b)||3!=g.get(d))return!1;g.delete(b);g.set(d,4);return!g.has(b)&&4==g.get(d)}catch(n){return!1}}())return f;var c='$jscomp_hidden_'+Math.random();m('freeze');m('preventExtensions');m('seal');var a=0;e.prototype.set=function(b,d){if(!k(b))throw Error('Invalid WeakMap key');l(b);if(!B(b,c))throw Error('WeakMap key fail: '+b);b[c][this.g]=d;return this};e.prototype.get=function(b){return k(b)&&B(b,c)?b[c][this.g]:void 0};e.prototype.has=function(b){return k(b)&&B(b,
c)&&B(b[c],this.g)};e.prototype.delete=function(b){return k(b)&&B(b,c)&&B(b[c],this.g)?delete b[c][this.g]:!1};return e});
w('Map',function(f){function e(){var a={};return a.j=a.next=a.head=a}function h(a,b){var d=a.g;return z(function(){if(d){for(;d.head!=a.g;)d=d.j;for(;d.next!=d.head;)return d=d.next,{done:!1,value:b(d)};d=null}return{done:!0,value:void 0}})}function k(a,b){var d=b&&typeof b;'object'==d||'function'==d?m.has(b)?d=m.get(b):(d=''+ ++c,m.set(b,d)):d='p_'+b;var g=a.i[d];if(g&&B(a.i,d))for(a=0;a<g.length;a++){var n=g[a];if(b!==b&&n.key!==n.key||b===n.key)return{id:d,list:g,index:a,h:n}}return{id:d,list:g,
index:-1,h:void 0}}function l(a){this.i={};this.g=e();this.size=0;if(a){a=A(a);for(var b;!(b=a.next()).done;)b=b.value,this.set(b[0],b[1])}}if(function(){if(!f||'function'!=typeof f||!f.prototype.entries||'function'!=typeof Object.seal)return!1;try{var a=Object.seal({x:4}),b=new f(A([[a,'s']]));if('s'!=b.get(a)||1!=b.size||b.get({x:4})||b.set({x:4},'t')!=b||2!=b.size)return!1;var d=b.entries(),g=d.next();if(g.done||g.value[0]!=a||'s'!=g.value[1])return!1;g=d.next();return g.done||4!=g.value[0].x||
't'!=g.value[1]||!d.next().done?!1:!0}catch(n){return!1}}())return f;var m=new WeakMap;l.prototype.set=function(a,b){a=0===a?0:a;var d=k(this,a);d.list||(d.list=this.i[d.id]=[]);d.h?d.h.value=b:(d.h={next:this.g,j:this.g.j,head:this.g,key:a,value:b},d.list.push(d.h),this.g.j.next=d.h,this.g.j=d.h,this.size++);return this};l.prototype.delete=function(a){a=k(this,a);return a.h&&a.list?(a.list.splice(a.index,1),a.list.length||delete this.i[a.id],a.h.j.next=a.h.next,a.h.next.j=a.h.j,a.h.head=null,this.size--,
!0):!1};l.prototype.clear=function(){this.i={};this.g=this.g.j=e();this.size=0};l.prototype.has=function(a){return!!k(this,a).h};l.prototype.get=function(a){return(a=k(this,a).h)&&a.value};l.prototype.entries=function(){return h(this,function(a){return[a.key,a.value]})};l.prototype.keys=function(){return h(this,function(a){return a.key})};l.prototype.values=function(){return h(this,function(a){return a.value})};l.prototype.forEach=function(a,b){for(var d=this.entries(),g;!(g=d.next()).done;)g=g.value,
a.call(b,g[1],g[0],this)};l.prototype[Symbol.iterator]=l.prototype.entries;var c=0;return l});
w('Promise',function(f){function e(c){this.i=0;this.l=void 0;this.g=[];this.v=!1;var a=this.m();try{c(a.resolve,a.reject)}catch(b){a.reject(b)}}function h(){this.g=null}function k(c){return c instanceof e?c:new e(function(a){a(c)})}if(f)return f;h.prototype.i=function(c){if(null==this.g){this.g=[];var a=this;this.l(function(){a.o()})}this.g.push(c)};var l=r.setTimeout;h.prototype.l=function(c){l(c,0)};h.prototype.o=function(){for(;this.g&&this.g.length;){var c=this.g;this.g=[];for(var a=0;a<c.length;++a){var b=
c[a];c[a]=null;try{b()}catch(d){this.m(d)}}}this.g=null};h.prototype.m=function(c){this.l(function(){throw c;})};e.prototype.m=function(){function c(d){return function(g){b||(b=!0,d.call(a,g))}}var a=this,b=!1;return{resolve:c(this.C),reject:c(this.o)}};e.prototype.C=function(c){if(c===this)this.o(new TypeError('A Promise cannot resolve to itself'));else if(c instanceof e)this.F(c);else{a:switch(typeof c){case 'object':var a=null!=c;break a;case 'function':a=!0;break a;default:a=!1}a?this.B(c):this.u(c)}};
e.prototype.B=function(c){var a=void 0;try{a=c.then}catch(b){this.o(b);return}'function'==typeof a?this.G(a,c):this.u(c)};e.prototype.o=function(c){this.A(2,c)};e.prototype.u=function(c){this.A(1,c)};e.prototype.A=function(c,a){if(0!=this.i)throw Error('Cannot settle('+c+', '+a+'): Promise already settled in state'+this.i);this.i=c;this.l=a;2===this.i&&this.D();this.H()};e.prototype.D=function(){var c=this;l(function(){if(c.I()){var a=r.console;'undefined'!==typeof a&&a.error(c.l)}},1)};e.prototype.I=
function(){if(this.v)return!1;var c=r.CustomEvent,a=r.Event,b=r.dispatchEvent;if('undefined'===typeof b)return!0;'function'===typeof c?c=new c('unhandledrejection',{cancelable:!0}):'function'===typeof a?c=new a('unhandledrejection',{cancelable:!0}):(c=r.document.createEvent('CustomEvent'),c.initCustomEvent('unhandledrejection',!1,!0,c));c.promise=this;c.reason=this.l;return b(c)};e.prototype.H=function(){if(null!=this.g){for(var c=0;c<this.g.length;++c)m.i(this.g[c]);this.g=null}};var m=new h;e.prototype.F=
function(c){var a=this.m();c.s(a.resolve,a.reject)};e.prototype.G=function(c,a){var b=this.m();try{c.call(a,b.resolve,b.reject)}catch(d){b.reject(d)}};e.prototype.then=function(c,a){function b(p,t){return'function'==typeof p?function(x){try{d(p(x))}catch(y){g(y)}}:t}var d,g,n=new e(function(p,t){d=p;g=t});this.s(b(c,d),b(a,g));return n};e.prototype.catch=function(c){return this.then(void 0,c)};e.prototype.s=function(c,a){function b(){switch(d.i){case 1:c(d.l);break;case 2:a(d.l);break;default:throw Error('Unexpected state: '+
d.i);}}var d=this;null==this.g?m.i(b):this.g.push(b);this.v=!0};e.resolve=k;e.reject=function(c){return new e(function(a,b){b(c)})};e.race=function(c){return new e(function(a,b){for(var d=A(c),g=d.next();!g.done;g=d.next())k(g.value).s(a,b)})};e.all=function(c){var a=A(c),b=a.next();return b.done?k([]):new e(function(d,g){function n(x){return function(y){p[x]=y;t--;0==t&&d(p)}}var p=[],t=0;do p.push(void 0),t++,k(b.value).s(n(p.length-1),g),b=a.next();while(!b.done)})};return e});function C(){var f=document.location.hash,e=f.indexOf('#');f=(0<=e?f.substring(e+1):'').split('&').filter(function(h){return 0<h.length}).map(function(h){return h.split('=',2).map(function(k){return decodeURIComponent(k)})});return new Map(f)}
function D(f){var e=document.createElement('script');e.src=f;e.type='text/javascript';new Promise(function(h,k){e.onload=function(){return h()};e.onerror=function(){return k(Error('Verification script URL failed to load.'))};document.getElementsByTagName('body')[0].appendChild(e)})}
document.addEventListener('DOMContentLoaded',function(){var f=C(),e=f.get('injectionId');f=f.get('verificationScriptUrl');if(!e)throw Error('Injection ID not provided.');if(!f)throw Error('Verification script URL not provided.');window.omidVerificationProperties={serviceWindow:window.parent,injectionSource:'web',injectionId:e};D(f)});
}).call(this, this);</script>
</body>
</html>
Loading