@joclaim/browser-extension-sdk 0.3.0 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- (()=>{var e={5606:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function c(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var a,u=[],s=!1,l=-1;function f(){s&&a&&(s=!1,a.length?u=a.concat(u):l=-1,u.length&&p())}function p(){if(!s){var e=c(f);s=!0;for(var t=u.length;t;){for(a=u,u=[];++l<t;)a&&a[l].run();l=-1,t=u.length}a=null,s=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function m(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||s||c(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}}},t={};var r=function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}(5606);function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",c=r.toStringTag||"@@toStringTag";function a(r,n,o,c){var a=n&&n.prototype instanceof s?n:s,l=Object.create(a.prototype);return i(l,"_invoke",function(r,n,o){var i,c,a,s=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,c=0,a=e,p.n=r,u}};function d(r,n){for(c=r,a=n,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,m=i[2];r>3?(o=m===n)&&(a=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,p.v=n,p.n=i[1]):d<m&&(o=r<3||i[0]>n||n>m)&&(i[4]=r,i[5]=n,p.n=m,c=0))}if(o||r>1)return u;throw f=!0,n}return function(o,l,m){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,m),c=l,a=m;(t=c<2?e:a)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,a)):p.n=a:p.v=a);try{if(s=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(f=p.n<0)?a:r.call(n,p))!==u)break}catch(t){i=e,c=1,a=t}finally{s=1}}return{value:t,done:f}}}(r,o,c),!0),l}var u={};function s(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(i(t={},n,function(){return this}),t),d=f.prototype=s.prototype=Object.create(p);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,i(e,c,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,i(d,"constructor",f),i(f,"constructor",l),l.displayName="GeneratorFunction",i(f,c,"GeneratorFunction"),i(d),i(d,c,"Generator"),i(d,n,function(){return this}),i(d,"toString",function(){return"[object Generator]"}),(o=function(){return{w:a,m}})()}function i(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}i=function(e,t,r,n){function c(t,r){i(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(c("next",0),c("throw",1),c("return",2))},i(e,t,r,n)}function c(e,t,r,n,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){c(i,n,o,a,u,"next",e)}function u(e){c(i,n,o,a,u,"throw",e)}a(void 0)})}}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}window.Reclaim=window.Reclaim||{};var l={};try{var f=localStorage.getItem("reclaimBrowserExtensionParameters");f&&(l=JSON.parse(f)||{})}catch(e){}Object.defineProperty(window.Reclaim,"parameters",{get:function(){if(Object.keys(l).length>0)return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},l);try{var e=localStorage.getItem("reclaimBrowserExtensionParameters");return e?JSON.parse(e):{}}catch(e){return{}}},set:function(){},enumerable:!0,configurable:!1}),window.Reclaim.updatePublicData=function(e){try{var t=JSON.stringify(null!=e?e:{});window.postMessage({action:"RECLAIM_SET_PUBLIC_DATA",data:{publicData:t}},"*")}catch(e){console.error("Reclaim.updatePublicData error:",e)}},window.Reclaim.canExpectManyClaims=function(e){try{window.postMessage({action:"RECLAIM_SET_EXPECT_MANY_CLAIMS",data:{expectMany:!!e}},"*")}catch(e){}},window.Reclaim.reportProviderError=function(e){try{window.postMessage({action:"RECLAIM_REPORT_PROVIDER_ERROR",data:{message:String(e||"Provider error")}},"*")}catch(e){console.error("Reclaim.reportProviderError error:",e)}},window.Reclaim.requestClaim=function(e){try{window.postMessage({action:"RECLAIM_REQUEST_CLAIM",data:{rdObject:e}},"*")}catch(e){console.error("Reclaim.requestClaim error:",e)}},window.Reclaim.getParametersSync=function(){try{var e=localStorage.getItem("reclaimBrowserExtensionParameters");return e?JSON.parse(e):{}}catch(e){return{}}},window.addEventListener("message",function(e){if(e.source===window){var t=e.data||{},r=t.action,n=t.data;if("RECLAIM_PARAMETERS_UPDATE"===r&&null!=n&&n.parameters){var o=n.parameters||{};if(0===Object.keys(o).length&&Object.keys(l).length>0)return;l=o;try{localStorage.setItem("reclaimBrowserExtensionParameters",JSON.stringify(l))}catch(e){}}}});try{window.postMessage({action:"RECLAIM_PARAMETERS_GET"},"*")}catch(e){}!function(){"use strict";var e=r.env.BACKEND_URL||"",t=function(t){return"".concat(e,"/api/providers/").concat(t,"/custom-injection")},n=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=console).error.apply(e,["❌ [Injection Script Error]:"].concat(r))},i=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=console).info.apply(e,["ℹ️ [Injection Script Info]:"].concat(r))};function c(){try{var e="reclaimBrowserExtensionProviderId",t=localStorage.getItem(e);return t?(i("Found provider ID in localStorage[".concat(e,"]: ").concat(t)),t):(n("Provider ID not found in local storage"),null)}catch(e){return n("Error accessing localStorage:",e),null}}function u(){return new Promise(function(e){var t=function(r){r.source===window&&"RECLAIM_PROVIDER_ID_RESPONSE"===r.data.action&&(window.removeEventListener("message",t),e(r.data.providerId))};window.addEventListener("message",t),window.postMessage({action:"RECLAIM_GET_PROVIDER_ID",source:"injection-script"},"*"),setTimeout(function(){window.removeEventListener("message",t),e(null)},5e3)})}function s(){return(s=a(o().m(function e(r){var c,a,u;return o().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,i("Fetching injection script for provider: ".concat(r)),e.n=1,fetch(t(r),{method:"GET",headers:{"Content-Type":"application/json","ngrok-skip-browser-warning":"true"}});case 1:if((c=e.v).ok){e.n=2;break}throw new Error("HTTP error! status: ".concat(c.status));case 2:return e.n=3,c.text();case 3:if((a=e.v)&&""!==a.trim()){e.n=4;break}return i("No injection script content found for provider: ".concat(r)),e.a(2,null);case 4:return i("Successfully fetched injection script for provider: ".concat(r)),e.a(2,{script:a,providerData:{providerId:r,name:"Unknown Provider"}});case 5:return e.p=5,u=e.v,n("Failed to fetch injection script for provider ".concat(r,":"),u),e.a(2,null)}},e,null,[[0,5]])}))).apply(this,arguments)}function l(e,t){return f.apply(this,arguments)}function f(){return(f=a(o().m(function e(t,r){return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,p(t);case 1:if(!e.v){e.n=2;break}return e.a(2);case 2:return e.n=3,d(t);case 3:if(!e.v){e.n=4;break}return e.a(2);case 4:try{i("Injected via chrome.scripting")}catch(e){n("All injection strategies failed",e)}case 5:return e.a(2)}},e)}))).apply(this,arguments)}function p(e){return new Promise(function(t){try{var r,n=new Blob([e],{type:"text/javascript"}),o=URL.createObjectURL(n),i=document.createElement("script");i.src=o,i.async=!1;var c=document.querySelector("script[nonce]"),a=(null==c?void 0:c.nonce)||(null==c||null===(r=c.getAttribute)||void 0===r?void 0:r.call(c,"nonce"))||"";a&&i.setAttribute("nonce",a),i.onload=function(){URL.revokeObjectURL(o),t(!0)},i.onerror=function(){URL.revokeObjectURL(o),t(!1)},(document.head||document.documentElement).appendChild(i)}catch(e){t(!1)}})}function d(e){return new Promise(function(t){try{var r,n=document.querySelector("script[nonce]"),o=(null==n?void 0:n.nonce)||(null==n||null===(r=n.getAttribute)||void 0===r?void 0:r.call(n,"nonce"))||"";if(!o)return t(!1);var i=document.createElement("script");i.setAttribute("nonce",o),i.textContent=String(e),(document.head||document.documentElement).appendChild(i),setTimeout(function(){return t(!0)},0)}catch(e){t(!1)}})}function m(){return v.apply(this,arguments)}function v(){return(v=a(o().m(function e(){var t,r,a;return o().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,t=c()){e.n=2;break}return i("Provider ID not found in localStorage, requesting from extension..."),e.n=1,u();case 1:t=e.v;case 2:if(t){e.n=3;break}return n("Cannot load injection script: Provider ID not found"),e.a(2);case 3:if(r=localStorage.getItem("reclaimBrowserExtensionInjectionScript:".concat(t))){e.n=4;break}return i("No injection script to execute"),e.a(2);case 4:l(r,{providerId:t,name:"Unknown Provider"}),e.n=6;break;case 5:e.p=5,a=e.v,n("Error in loadAndExecuteInjectionScript:",a);case 6:return e.a(2)}},e,null,[[0,5]])}))).apply(this,arguments)}window.reclaimInjectionLoader={loadAndExecuteInjectionScript:m,getProviderIdFromStorage:c,getProviderIdFromExtension:u,fetchProviderInjectionScript:function(e){return s.apply(this,arguments)},executeInjectionScriptNoEval:l},i("Reclaim Injection Script Loader initialized and injected successfully"),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",m):m()}()})();
1
+ (()=>{var e={5606(e){var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function c(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var a,u=[],s=!1,l=-1;function f(){s&&a&&(s=!1,a.length?u=a.concat(u):l=-1,u.length&&p())}function p(){if(!s){var e=c(f);s=!0;for(var t=u.length;t;){for(a=u,u=[];++l<t;)a&&a[l].run();l=-1,t=u.length}a=null,s=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function m(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||s||c(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}}},t={};var r=function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}(5606);function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",c=r.toStringTag||"@@toStringTag";function a(r,n,o,c){var a=n&&n.prototype instanceof s?n:s,l=Object.create(a.prototype);return i(l,"_invoke",function(r,n,o){var i,c,a,s=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,c=0,a=e,p.n=r,u}};function d(r,n){for(c=r,a=n,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,m=i[2];r>3?(o=m===n)&&(a=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,p.v=n,p.n=i[1]):d<m&&(o=r<3||i[0]>n||n>m)&&(i[4]=r,i[5]=n,p.n=m,c=0))}if(o||r>1)return u;throw f=!0,n}return function(o,l,m){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,m),c=l,a=m;(t=c<2?e:a)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,a)):p.n=a:p.v=a);try{if(s=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(f=p.n<0)?a:r.call(n,p))!==u)break}catch(t){i=e,c=1,a=t}finally{s=1}}return{value:t,done:f}}}(r,o,c),!0),l}var u={};function s(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(i(t={},n,function(){return this}),t),d=f.prototype=s.prototype=Object.create(p);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,i(e,c,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,i(d,"constructor",f),i(f,"constructor",l),l.displayName="GeneratorFunction",i(f,c,"GeneratorFunction"),i(d),i(d,c,"Generator"),i(d,n,function(){return this}),i(d,"toString",function(){return"[object Generator]"}),(o=function(){return{w:a,m}})()}function i(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}i=function(e,t,r,n){function c(t,r){i(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(c("next",0),c("throw",1),c("return",2))},i(e,t,r,n)}function c(e,t,r,n,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){c(i,n,o,a,u,"next",e)}function u(e){c(i,n,o,a,u,"throw",e)}a(void 0)})}}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}window.Reclaim=window.Reclaim||{};var l={};try{var f=localStorage.getItem("reclaimBrowserExtensionParameters");f&&(l=JSON.parse(f)||{})}catch(e){}Object.defineProperty(window.Reclaim,"parameters",{get:function(){if(Object.keys(l).length>0)return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},l);try{var e=localStorage.getItem("reclaimBrowserExtensionParameters");return e?JSON.parse(e):{}}catch(e){return{}}},set:function(){},enumerable:!0,configurable:!1}),window.Reclaim.updatePublicData=function(e){try{var t=JSON.stringify(null!=e?e:{});window.postMessage({action:"RECLAIM_SET_PUBLIC_DATA",data:{publicData:t}},"*")}catch(e){console.error("Reclaim.updatePublicData error:",e)}},window.Reclaim.canExpectManyClaims=function(e){try{window.postMessage({action:"RECLAIM_SET_EXPECT_MANY_CLAIMS",data:{expectMany:!!e}},"*")}catch(e){}},window.Reclaim.reportProviderError=function(e){try{window.postMessage({action:"RECLAIM_REPORT_PROVIDER_ERROR",data:{message:String(e||"Provider error")}},"*")}catch(e){console.error("Reclaim.reportProviderError error:",e)}},window.Reclaim.requestClaim=function(e){try{window.postMessage({action:"RECLAIM_REQUEST_CLAIM",data:{rdObject:e}},"*")}catch(e){console.error("Reclaim.requestClaim error:",e)}},window.Reclaim.getParametersSync=function(){try{var e=localStorage.getItem("reclaimBrowserExtensionParameters");return e?JSON.parse(e):{}}catch(e){return{}}},window.addEventListener("message",function(e){if(e.source===window){var t=e.data||{},r=t.action,n=t.data;if("RECLAIM_PARAMETERS_UPDATE"===r&&null!=n&&n.parameters){var o=n.parameters||{};if(0===Object.keys(o).length&&Object.keys(l).length>0)return;l=o;try{localStorage.setItem("reclaimBrowserExtensionParameters",JSON.stringify(l))}catch(e){}}}});try{window.postMessage({action:"RECLAIM_PARAMETERS_GET"},"*")}catch(e){}!function(){"use strict";var e=r.env.BACKEND_URL||"",t=function(t){return"".concat(e,"/api/providers/").concat(t,"/custom-injection")},n=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=console).error.apply(e,["❌ [Injection Script Error]:"].concat(r))},i=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=console).info.apply(e,["ℹ️ [Injection Script Info]:"].concat(r))};function c(){try{var e="reclaimBrowserExtensionProviderId",t=localStorage.getItem(e);return t?(i("Found provider ID in localStorage[".concat(e,"]: ").concat(t)),t):(n("Provider ID not found in local storage"),null)}catch(e){return n("Error accessing localStorage:",e),null}}function u(){return new Promise(function(e){var t=function(r){r.source===window&&"RECLAIM_PROVIDER_ID_RESPONSE"===r.data.action&&(window.removeEventListener("message",t),e(r.data.providerId))};window.addEventListener("message",t),window.postMessage({action:"RECLAIM_GET_PROVIDER_ID",source:"injection-script"},"*"),setTimeout(function(){window.removeEventListener("message",t),e(null)},5e3)})}function s(){return(s=a(o().m(function e(r){var c,a,u;return o().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,i("Fetching injection script for provider: ".concat(r)),e.n=1,fetch(t(r),{method:"GET",headers:{"Content-Type":"application/json","ngrok-skip-browser-warning":"true"}});case 1:if((c=e.v).ok){e.n=2;break}throw new Error("HTTP error! status: ".concat(c.status));case 2:return e.n=3,c.text();case 3:if((a=e.v)&&""!==a.trim()){e.n=4;break}return i("No injection script content found for provider: ".concat(r)),e.a(2,null);case 4:return i("Successfully fetched injection script for provider: ".concat(r)),e.a(2,{script:a,providerData:{providerId:r,name:"Unknown Provider"}});case 5:return e.p=5,u=e.v,n("Failed to fetch injection script for provider ".concat(r,":"),u),e.a(2,null)}},e,null,[[0,5]])}))).apply(this,arguments)}function l(e,t){return f.apply(this,arguments)}function f(){return(f=a(o().m(function e(t,r){return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,p(t);case 1:if(!e.v){e.n=2;break}return e.a(2);case 2:return e.n=3,d(t);case 3:if(!e.v){e.n=4;break}return e.a(2);case 4:try{i("Injected via chrome.scripting")}catch(e){n("All injection strategies failed",e)}case 5:return e.a(2)}},e)}))).apply(this,arguments)}function p(e){return new Promise(function(t){try{var r,n=new Blob([e],{type:"text/javascript"}),o=URL.createObjectURL(n),i=document.createElement("script");i.src=o,i.async=!1;var c=document.querySelector("script[nonce]"),a=(null==c?void 0:c.nonce)||(null==c||null===(r=c.getAttribute)||void 0===r?void 0:r.call(c,"nonce"))||"";a&&i.setAttribute("nonce",a),i.onload=function(){URL.revokeObjectURL(o),t(!0)},i.onerror=function(){URL.revokeObjectURL(o),t(!1)},(document.head||document.documentElement).appendChild(i)}catch(e){t(!1)}})}function d(e){return new Promise(function(t){try{var r,n=document.querySelector("script[nonce]"),o=(null==n?void 0:n.nonce)||(null==n||null===(r=n.getAttribute)||void 0===r?void 0:r.call(n,"nonce"))||"";if(!o)return t(!1);var i=document.createElement("script");i.setAttribute("nonce",o),i.textContent=String(e),(document.head||document.documentElement).appendChild(i),setTimeout(function(){return t(!0)},0)}catch(e){t(!1)}})}function m(){return v.apply(this,arguments)}function v(){return(v=a(o().m(function e(){var t,r,a;return o().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,t=c()){e.n=2;break}return i("Provider ID not found in localStorage, requesting from extension..."),e.n=1,u();case 1:t=e.v;case 2:if(t){e.n=3;break}return n("Cannot load injection script: Provider ID not found"),e.a(2);case 3:if(r=localStorage.getItem("reclaimBrowserExtensionInjectionScript:".concat(t))){e.n=4;break}return i("No injection script to execute"),e.a(2);case 4:l(r,{providerId:t,name:"Unknown Provider"}),e.n=6;break;case 5:e.p=5,a=e.v,n("Error in loadAndExecuteInjectionScript:",a);case 6:return e.a(2)}},e,null,[[0,5]])}))).apply(this,arguments)}window.reclaimInjectionLoader={loadAndExecuteInjectionScript:m,getProviderIdFromStorage:c,getProviderIdFromExtension:u,fetchProviderInjectionScript:function(e){return s.apply(this,arguments)},executeInjectionScriptNoEval:l},i("Reclaim Injection Script Loader initialized and injected successfully"),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",m):m()}()})();
2
2
  //# sourceMappingURL=injection-scripts.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interceptor/injection-scripts.bundle.js","mappings":"sBACA,IAOIA,EACAC,EARAC,EAAUC,EAAO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AAA,kBAEjEzM,MAAA,KAAAJ,UAAA,CAgBD2F,OAAOsH,uBAAyB,CAC9BN,8BAAAA,EACA1D,yBAAAA,EACAE,2BAAAA,EACA+D,6BA3NF,SAG2CC,GAAA,OAAA5D,EAAAnJ,MAAC,KAADJ,UAAA,EAyNzCsK,6BAAAA,GAIF7B,EAAW,yEAlBmB,YAAxB8C,SAAS6B,WACX7B,SAASxD,iBAAiB,mBAAoB4E,GAG9CA,GAgBL,CA3TD,E","sources":["webpack://@joclaim/browser-extension-sdk/./node_modules/process/browser.js","webpack://@joclaim/browser-extension-sdk/webpack/bootstrap","webpack://@joclaim/browser-extension-sdk/./src/interceptor/injection-scripts.js"],"sourcesContent":["// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","window.Reclaim = window.Reclaim || {};\nlet __reclaimParams = {};\n\ntry {\n const ls = localStorage.getItem(\"reclaimBrowserExtensionParameters\");\n if (ls) __reclaimParams = JSON.parse(ls) || {};\n} catch {}\n\nObject.defineProperty(window.Reclaim, \"parameters\", {\n get: () => {\n if (Object.keys(__reclaimParams).length > 0) return { ...__reclaimParams };\n try {\n const ls = localStorage.getItem(\"reclaimBrowserExtensionParameters\");\n return ls ? JSON.parse(ls) : {};\n } catch {\n return {};\n }\n },\n set: () => {},\n enumerable: true,\n configurable: false,\n});\n\nwindow.Reclaim.updatePublicData = function (obj) {\n try {\n const publicData = JSON.stringify(obj ?? {});\n window.postMessage(\n {\n action: \"RECLAIM_SET_PUBLIC_DATA\",\n data: { publicData },\n },\n \"*\",\n );\n } catch (e) {\n console.error(\"Reclaim.updatePublicData error:\", e);\n }\n};\n\nwindow.Reclaim.canExpectManyClaims = function (flag) {\n try {\n window.postMessage(\n { action: \"RECLAIM_SET_EXPECT_MANY_CLAIMS\", data: { expectMany: !!flag } },\n \"*\",\n );\n } catch {}\n};\n\nwindow.Reclaim.reportProviderError = function (msg) {\n try {\n window.postMessage(\n {\n action: \"RECLAIM_REPORT_PROVIDER_ERROR\",\n data: { message: String(msg || \"Provider error\") },\n },\n \"*\",\n );\n } catch (e) {\n console.error(\"Reclaim.reportProviderError error:\", e);\n }\n};\n\nwindow.Reclaim.requestClaim = function (rdObject) {\n try {\n window.postMessage({ action: \"RECLAIM_REQUEST_CLAIM\", data: { rdObject } }, \"*\");\n } catch (e) {\n console.error(\"Reclaim.requestClaim error:\", e);\n }\n};\n\nwindow.Reclaim.getParametersSync = function () {\n try {\n const ls = localStorage.getItem(\"reclaimBrowserExtensionParameters\");\n return ls ? JSON.parse(ls) : {};\n } catch {\n return {};\n }\n};\n\nwindow.addEventListener(\"message\", (e) => {\n if (e.source !== window) return;\n const { action, data } = e.data || {};\n if (action === \"RECLAIM_PARAMETERS_UPDATE\" && data?.parameters) {\n const p = data.parameters || {};\n if (Object.keys(p).length === 0 && Object.keys(__reclaimParams).length > 0) return;\n __reclaimParams = p;\n try {\n localStorage.setItem(\"reclaimBrowserExtensionParameters\", JSON.stringify(__reclaimParams));\n } catch {}\n }\n});\n\ntry {\n window.postMessage({ action: \"RECLAIM_PARAMETERS_GET\" }, \"*\");\n} catch {}\n\n/**\n * Dynamic Injection Script Loader\n * Fetches provider-specific injection scripts from the backend and executes them\n * This script is injected into the main world of the website\n */\n\n(function () {\n \"use strict\";\n\n // Backend API configuration\n const BACKEND_URL = process.env.BACKEND_URL || \"\";\n const PROVIDER_API_ENDPOINT = (providerId) =>\n `${BACKEND_URL}/api/providers/${providerId}/custom-injection`;\n\n // Debug utility for logging\n const debug = {\n log: (...args) => console.log(\"🔍 [Injection Script]:\", ...args),\n error: (...args) => console.error(\"❌ [Injection Script Error]:\", ...args),\n info: (...args) => console.info(\"ℹ️ [Injection Script Info]:\", ...args),\n // log: (...args) => undefined,\n // error: (...args) => undefined,\n // info: (...args) => undefined\n };\n\n /**\n * IMPORTANT: localStorage Context Isolation\n *\n * - background.js runs in extension context (chrome-extension://extension-id/)\n * - This injection script runs in website context (https://example.com/)\n * - These have SEPARATE localStorage spaces - they cannot share data directly\n *\n * Solutions:\n * 1. Content script acts as bridge (can access both contexts)\n * 2. Use chrome.storage API via content script\n * 3. Use postMessage communication between content script and injection script\n */\n\n /**\n * Safely retrieve provider ID from localStorage\n * Note: This only works if the provider ID was set by the website itself\n * or by a content script that has access to the website's localStorage\n */\n function getProviderIdFromStorage() {\n try {\n // Simplified to single key as per user's modification\n const keyValue = \"reclaimBrowserExtensionProviderId\";\n const value = localStorage.getItem(keyValue);\n if (value) {\n debug.info(`Found provider ID in localStorage[${keyValue}]: ${value}`);\n return value;\n }\n\n debug.error(\"Provider ID not found in local storage\");\n return null;\n } catch (error) {\n debug.error(\"Error accessing localStorage:\", error);\n return null;\n }\n }\n\n /**\n * Alternative: Get provider ID from extension via content script bridge\n * This method uses postMessage to communicate with content script\n */\n function getProviderIdFromExtension() {\n return new Promise((resolve) => {\n // Listen for response from content script\n const handleMessage = (event) => {\n if (event.source !== window) return;\n\n if (event.data.action === \"RECLAIM_PROVIDER_ID_RESPONSE\") {\n window.removeEventListener(\"message\", handleMessage);\n resolve(event.data.providerId);\n }\n };\n\n window.addEventListener(\"message\", handleMessage);\n\n // Request provider ID from content script\n window.postMessage(\n {\n action: \"RECLAIM_GET_PROVIDER_ID\",\n source: \"injection-script\",\n },\n \"*\",\n );\n\n // Timeout after 5 seconds\n setTimeout(() => {\n window.removeEventListener(\"message\", handleMessage);\n resolve(null);\n }, 5000);\n });\n }\n\n /**\n * Fetch provider data including custom injection script from backend\n */\n async function fetchProviderInjectionScript(providerId) {\n try {\n debug.info(`Fetching injection script for provider: ${providerId}`);\n\n const response = await fetch(PROVIDER_API_ENDPOINT(providerId), {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"ngrok-skip-browser-warning\": \"true\",\n },\n });\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n const scriptContent = await response.text();\n\n // Check if we got a valid script\n if (!scriptContent || scriptContent.trim() === \"\") {\n debug.info(`No injection script content found for provider: ${providerId}`);\n return null;\n }\n\n debug.info(`Successfully fetched injection script for provider: ${providerId}`);\n return {\n script: scriptContent,\n providerData: {\n providerId: providerId,\n name: \"Unknown Provider\",\n },\n };\n } catch (error) {\n debug.error(`Failed to fetch injection script for provider ${providerId}:`, error);\n return null;\n }\n }\n\n /**\n * Execute the fetched injection script without eval\n */\n function executeInjectionScriptNoEval2(scriptContent, providerData) {\n const finish = (ok) => {\n if (!ok) return; /* dispatch success event */\n };\n\n // 1) Inline without nonce (Steam allows 'unsafe-inline')\n try {\n const inl = document.createElement(\"script\");\n inl.textContent = String(scriptContent);\n (document.documentElement || document.head || document).insertBefore(\n inl,\n (document.documentElement || document.head).firstChild,\n );\n finish(true);\n return;\n } catch {}\n\n // 2) Inline with page nonce\n try {\n const nonceEl = document.querySelector(\"script[nonce]\");\n const pageNonce = nonceEl?.nonce || nonceEl?.getAttribute?.(\"nonce\") || \"\";\n if (!pageNonce) throw new Error(\"No page nonce found\");\n const inl = document.createElement(\"script\");\n inl.nonce = pageNonce;\n inl.textContent = String(scriptContent);\n (document.documentElement || document.head || document).insertBefore(\n inl,\n (document.documentElement || document.head).firstChild,\n );\n finish(true);\n return;\n } catch {}\n\n // 3) unsafe-eval fallback (Steam allows it)\n try {\n (0, eval)(String(scriptContent));\n finish(true);\n return;\n } catch (e) {\n debug.error(\"Injection failed:\", e);\n finish(false);\n }\n }\n\n async function executeInjectionScriptNoEval(scriptContent, providerData) {\n // 1) Try blob: URL (most robust without eval/inline)\n const okBlob = await injectViaBlob(scriptContent);\n if (okBlob) return;\n\n // // 2) Try page nonce (only if present). Still brittle, but cheap to try.\n const okNonce = await injectInlineWithNonce(scriptContent);\n if (okNonce) return;\n\n // 3) Last resort: ask the service worker to inject via chrome.scripting\n try {\n debug.info(\"Injected via chrome.scripting\");\n } catch (e) {\n debug.error(\"All injection strategies failed\", e);\n }\n }\n\n function injectViaBlob(code) {\n return new Promise((resolve) => {\n try {\n const blob = new Blob([code], { type: \"text/javascript\" });\n const url = URL.createObjectURL(blob);\n\n const s = document.createElement(\"script\");\n s.src = url;\n s.async = false;\n\n // If a page nonce exists, attach it (harmless if not needed)\n const nonceEl = document.querySelector(\"script[nonce]\");\n const pageNonce = nonceEl?.nonce || nonceEl?.getAttribute?.(\"nonce\") || \"\";\n if (pageNonce) s.setAttribute(\"nonce\", pageNonce);\n\n s.onload = () => {\n URL.revokeObjectURL(url);\n resolve(true);\n };\n s.onerror = () => {\n URL.revokeObjectURL(url);\n resolve(false);\n };\n\n (document.head || document.documentElement).appendChild(s);\n } catch {\n resolve(false);\n }\n });\n }\n\n function injectInlineWithNonce(code) {\n return new Promise((resolve) => {\n try {\n const nonceEl = document.querySelector(\"script[nonce]\");\n const pageNonce = nonceEl?.nonce || nonceEl?.getAttribute?.(\"nonce\") || \"\";\n if (!pageNonce) return resolve(false);\n\n // Inline + nonce (no reliable onload; we assume success if no sync error)\n const s = document.createElement(\"script\");\n s.setAttribute(\"nonce\", pageNonce);\n s.textContent = String(code);\n\n (document.head || document.documentElement).appendChild(s);\n\n // Give the browser a tick; if CSP blocked it, you’ll usually see a console error.\n setTimeout(() => resolve(true), 0);\n } catch {\n resolve(false);\n }\n });\n }\n\n /**\n * Main function to load and execute injection script\n */\n async function loadAndExecuteInjectionScript() {\n try {\n // Try to get provider ID from localStorage first\n let providerId = getProviderIdFromStorage();\n // const providerId = \"8f8f3def-7864-4dae-890d-9e95c5e45bec\"\n\n // If not found in localStorage, try to get from extension\n if (!providerId) {\n debug.info(\"Provider ID not found in localStorage, requesting from extension...\");\n providerId = await getProviderIdFromExtension();\n }\n\n if (!providerId) {\n debug.error(\"Cannot load injection script: Provider ID not found\");\n return;\n }\n\n // Fetch the injection script from localStorage\n const injectionScript = localStorage.getItem(\n `reclaimBrowserExtensionInjectionScript:${providerId}`,\n );\n\n if (!injectionScript) {\n debug.info(\"No injection script to execute\");\n return;\n }\n\n const providerData = {\n providerId: providerId,\n name: \"Unknown Provider\",\n };\n\n // Execute the fetched script\n // executeInjectionScript(injectionScript, providerData);\n executeInjectionScriptNoEval(injectionScript, providerData);\n } catch (error) {\n debug.error(\"Error in loadAndExecuteInjectionScript:\", error);\n }\n }\n\n /**\n * Initialize the injection script loader\n * Waits for DOM to be ready before executing\n */\n function initializeInjectionLoader() {\n if (document.readyState === \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", loadAndExecuteInjectionScript);\n } else {\n // DOM is already ready\n loadAndExecuteInjectionScript();\n }\n }\n\n // Expose utilities globally for debugging and external access\n window.reclaimInjectionLoader = {\n loadAndExecuteInjectionScript,\n getProviderIdFromStorage,\n getProviderIdFromExtension,\n fetchProviderInjectionScript,\n executeInjectionScriptNoEval,\n };\n\n // Initialize the loader\n debug.info(\"Reclaim Injection Script Loader initialized and injected successfully\");\n initializeInjectionLoader();\n})();\n"],"names":["cachedSetTimeout","cachedClearTimeout","process","module","exports","defaultSetTimout","Error","defaultClearTimeout","runTimeout","fun","setTimeout","e","call","this","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","length","concat","drainQueue","timeout","len","run","marker","runClearTimeout","Item","array","noop","nextTick","args","Array","arguments","i","push","prototype","apply","title","browser","env","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","name","binding","cwd","chdir","dir","umask","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","t","r","Symbol","n","iterator","o","toStringTag","c","Generator","u","Object","create","_regeneratorDefine2","f","p","y","G","v","a","d","bind","l","TypeError","done","value","GeneratorFunction","GeneratorFunctionPrototype","getPrototypeOf","setPrototypeOf","__proto__","displayName","_regenerator","w","m","defineProperty","_invoke","enumerable","configurable","writable","asyncGeneratorStep","Promise","resolve","then","_asyncToGenerator","_next","_throw","ownKeys","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","_defineProperty","_typeof","toPrimitive","String","Number","_toPrimitive","_toPropertyKey","window","Reclaim","__reclaimParams","ls","localStorage","getItem","JSON","parse","_unused","get","forEach","getOwnPropertyDescriptors","defineProperties","_objectSpread","_unused2","set","updatePublicData","obj","publicData","stringify","postMessage","action","data","console","error","canExpectManyClaims","flag","expectMany","_unused3","reportProviderError","msg","message","requestClaim","rdObject","getParametersSync","_unused4","addEventListener","source","_ref","parameters","setItem","_unused5","_unused6","BACKEND_URL","PROVIDER_API_ENDPOINT","providerId","debug","_console2","_len2","_key2","_console3","_len3","_key3","info","getProviderIdFromStorage","keyValue","getProviderIdFromExtension","handleMessage","event","removeEventListener","_fetchProviderInjectionScript","_callee","response","scriptContent","_t","_context","fetch","method","headers","ok","status","text","trim","script","providerData","executeInjectionScriptNoEval","_x2","_x3","_executeInjectionScriptNoEval","_callee2","_context2","injectViaBlob","injectInlineWithNonce","code","_nonceEl$getAttribute2","blob","Blob","type","url","URL","createObjectURL","s","document","createElement","src","async","nonceEl","querySelector","pageNonce","nonce","getAttribute","setAttribute","onload","revokeObjectURL","onerror","head","documentElement","appendChild","_unused9","_nonceEl$getAttribute3","textContent","_unused0","loadAndExecuteInjectionScript","_loadAndExecuteInjectionScript","_callee3","injectionScript","_t2","_context3","reclaimInjectionLoader","fetchProviderInjectionScript","_x","readyState"],"sourceRoot":""}
1
+ {"version":3,"file":"interceptor/injection-scripts.bundle.js","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yCsE,GAAS,cAAAC,EAAA7J,EAAA,KAAA0J,EAAA,kBAEjEzM,MAAA,KAAAJ,UAAA,CAgBD2F,OAAOsH,uBAAyB,CAC9BN,8BAAAA,EACA1D,yBAAAA,EACAE,2BAAAA,EACA+D,6BA3NF,SAG2CC,GAAA,OAAA5D,EAAAnJ,MAAC,KAADJ,UAAA,EAyNzCsK,6BAAAA,GAIF7B,EAAW,yEAlBmB,YAAxB8C,SAAS6B,WACX7B,SAASxD,iBAAiB,mBAAoB4E,GAG9CA,GAgBL,CA3TD,E","sources":["webpack://@joclaim/browser-extension-sdk/./node_modules/process/browser.js","webpack://@joclaim/browser-extension-sdk/webpack/bootstrap","webpack://@joclaim/browser-extension-sdk/./src/interceptor/injection-scripts.js"],"sourcesContent":["// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","window.Reclaim = window.Reclaim || {};\nlet __reclaimParams = {};\n\ntry {\n const ls = localStorage.getItem(\"reclaimBrowserExtensionParameters\");\n if (ls) __reclaimParams = JSON.parse(ls) || {};\n} catch {}\n\nObject.defineProperty(window.Reclaim, \"parameters\", {\n get: () => {\n if (Object.keys(__reclaimParams).length > 0) return { ...__reclaimParams };\n try {\n const ls = localStorage.getItem(\"reclaimBrowserExtensionParameters\");\n return ls ? JSON.parse(ls) : {};\n } catch {\n return {};\n }\n },\n set: () => {},\n enumerable: true,\n configurable: false,\n});\n\nwindow.Reclaim.updatePublicData = function (obj) {\n try {\n const publicData = JSON.stringify(obj ?? {});\n window.postMessage(\n {\n action: \"RECLAIM_SET_PUBLIC_DATA\",\n data: { publicData },\n },\n \"*\",\n );\n } catch (e) {\n console.error(\"Reclaim.updatePublicData error:\", e);\n }\n};\n\nwindow.Reclaim.canExpectManyClaims = function (flag) {\n try {\n window.postMessage(\n { action: \"RECLAIM_SET_EXPECT_MANY_CLAIMS\", data: { expectMany: !!flag } },\n \"*\",\n );\n } catch {}\n};\n\nwindow.Reclaim.reportProviderError = function (msg) {\n try {\n window.postMessage(\n {\n action: \"RECLAIM_REPORT_PROVIDER_ERROR\",\n data: { message: String(msg || \"Provider error\") },\n },\n \"*\",\n );\n } catch (e) {\n console.error(\"Reclaim.reportProviderError error:\", e);\n }\n};\n\nwindow.Reclaim.requestClaim = function (rdObject) {\n try {\n window.postMessage({ action: \"RECLAIM_REQUEST_CLAIM\", data: { rdObject } }, \"*\");\n } catch (e) {\n console.error(\"Reclaim.requestClaim error:\", e);\n }\n};\n\nwindow.Reclaim.getParametersSync = function () {\n try {\n const ls = localStorage.getItem(\"reclaimBrowserExtensionParameters\");\n return ls ? JSON.parse(ls) : {};\n } catch {\n return {};\n }\n};\n\nwindow.addEventListener(\"message\", (e) => {\n if (e.source !== window) return;\n const { action, data } = e.data || {};\n if (action === \"RECLAIM_PARAMETERS_UPDATE\" && data?.parameters) {\n const p = data.parameters || {};\n if (Object.keys(p).length === 0 && Object.keys(__reclaimParams).length > 0) return;\n __reclaimParams = p;\n try {\n localStorage.setItem(\"reclaimBrowserExtensionParameters\", JSON.stringify(__reclaimParams));\n } catch {}\n }\n});\n\ntry {\n window.postMessage({ action: \"RECLAIM_PARAMETERS_GET\" }, \"*\");\n} catch {}\n\n/**\n * Dynamic Injection Script Loader\n * Fetches provider-specific injection scripts from the backend and executes them\n * This script is injected into the main world of the website\n */\n\n(function () {\n \"use strict\";\n\n // Backend API configuration\n const BACKEND_URL = process.env.BACKEND_URL || \"\";\n const PROVIDER_API_ENDPOINT = (providerId) =>\n `${BACKEND_URL}/api/providers/${providerId}/custom-injection`;\n\n // Debug utility for logging\n const debug = {\n log: (...args) => console.log(\"🔍 [Injection Script]:\", ...args),\n error: (...args) => console.error(\"❌ [Injection Script Error]:\", ...args),\n info: (...args) => console.info(\"ℹ️ [Injection Script Info]:\", ...args),\n // log: (...args) => undefined,\n // error: (...args) => undefined,\n // info: (...args) => undefined\n };\n\n /**\n * IMPORTANT: localStorage Context Isolation\n *\n * - background.js runs in extension context (chrome-extension://extension-id/)\n * - This injection script runs in website context (https://example.com/)\n * - These have SEPARATE localStorage spaces - they cannot share data directly\n *\n * Solutions:\n * 1. Content script acts as bridge (can access both contexts)\n * 2. Use chrome.storage API via content script\n * 3. Use postMessage communication between content script and injection script\n */\n\n /**\n * Safely retrieve provider ID from localStorage\n * Note: This only works if the provider ID was set by the website itself\n * or by a content script that has access to the website's localStorage\n */\n function getProviderIdFromStorage() {\n try {\n // Simplified to single key as per user's modification\n const keyValue = \"reclaimBrowserExtensionProviderId\";\n const value = localStorage.getItem(keyValue);\n if (value) {\n debug.info(`Found provider ID in localStorage[${keyValue}]: ${value}`);\n return value;\n }\n\n debug.error(\"Provider ID not found in local storage\");\n return null;\n } catch (error) {\n debug.error(\"Error accessing localStorage:\", error);\n return null;\n }\n }\n\n /**\n * Alternative: Get provider ID from extension via content script bridge\n * This method uses postMessage to communicate with content script\n */\n function getProviderIdFromExtension() {\n return new Promise((resolve) => {\n // Listen for response from content script\n const handleMessage = (event) => {\n if (event.source !== window) return;\n\n if (event.data.action === \"RECLAIM_PROVIDER_ID_RESPONSE\") {\n window.removeEventListener(\"message\", handleMessage);\n resolve(event.data.providerId);\n }\n };\n\n window.addEventListener(\"message\", handleMessage);\n\n // Request provider ID from content script\n window.postMessage(\n {\n action: \"RECLAIM_GET_PROVIDER_ID\",\n source: \"injection-script\",\n },\n \"*\",\n );\n\n // Timeout after 5 seconds\n setTimeout(() => {\n window.removeEventListener(\"message\", handleMessage);\n resolve(null);\n }, 5000);\n });\n }\n\n /**\n * Fetch provider data including custom injection script from backend\n */\n async function fetchProviderInjectionScript(providerId) {\n try {\n debug.info(`Fetching injection script for provider: ${providerId}`);\n\n const response = await fetch(PROVIDER_API_ENDPOINT(providerId), {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"ngrok-skip-browser-warning\": \"true\",\n },\n });\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n const scriptContent = await response.text();\n\n // Check if we got a valid script\n if (!scriptContent || scriptContent.trim() === \"\") {\n debug.info(`No injection script content found for provider: ${providerId}`);\n return null;\n }\n\n debug.info(`Successfully fetched injection script for provider: ${providerId}`);\n return {\n script: scriptContent,\n providerData: {\n providerId: providerId,\n name: \"Unknown Provider\",\n },\n };\n } catch (error) {\n debug.error(`Failed to fetch injection script for provider ${providerId}:`, error);\n return null;\n }\n }\n\n /**\n * Execute the fetched injection script without eval\n */\n function executeInjectionScriptNoEval2(scriptContent, providerData) {\n const finish = (ok) => {\n if (!ok) return; /* dispatch success event */\n };\n\n // 1) Inline without nonce (Steam allows 'unsafe-inline')\n try {\n const inl = document.createElement(\"script\");\n inl.textContent = String(scriptContent);\n (document.documentElement || document.head || document).insertBefore(\n inl,\n (document.documentElement || document.head).firstChild,\n );\n finish(true);\n return;\n } catch {}\n\n // 2) Inline with page nonce\n try {\n const nonceEl = document.querySelector(\"script[nonce]\");\n const pageNonce = nonceEl?.nonce || nonceEl?.getAttribute?.(\"nonce\") || \"\";\n if (!pageNonce) throw new Error(\"No page nonce found\");\n const inl = document.createElement(\"script\");\n inl.nonce = pageNonce;\n inl.textContent = String(scriptContent);\n (document.documentElement || document.head || document).insertBefore(\n inl,\n (document.documentElement || document.head).firstChild,\n );\n finish(true);\n return;\n } catch {}\n\n // 3) unsafe-eval fallback (Steam allows it)\n try {\n (0, eval)(String(scriptContent));\n finish(true);\n return;\n } catch (e) {\n debug.error(\"Injection failed:\", e);\n finish(false);\n }\n }\n\n async function executeInjectionScriptNoEval(scriptContent, providerData) {\n // 1) Try blob: URL (most robust without eval/inline)\n const okBlob = await injectViaBlob(scriptContent);\n if (okBlob) return;\n\n // // 2) Try page nonce (only if present). Still brittle, but cheap to try.\n const okNonce = await injectInlineWithNonce(scriptContent);\n if (okNonce) return;\n\n // 3) Last resort: ask the service worker to inject via chrome.scripting\n try {\n debug.info(\"Injected via chrome.scripting\");\n } catch (e) {\n debug.error(\"All injection strategies failed\", e);\n }\n }\n\n function injectViaBlob(code) {\n return new Promise((resolve) => {\n try {\n const blob = new Blob([code], { type: \"text/javascript\" });\n const url = URL.createObjectURL(blob);\n\n const s = document.createElement(\"script\");\n s.src = url;\n s.async = false;\n\n // If a page nonce exists, attach it (harmless if not needed)\n const nonceEl = document.querySelector(\"script[nonce]\");\n const pageNonce = nonceEl?.nonce || nonceEl?.getAttribute?.(\"nonce\") || \"\";\n if (pageNonce) s.setAttribute(\"nonce\", pageNonce);\n\n s.onload = () => {\n URL.revokeObjectURL(url);\n resolve(true);\n };\n s.onerror = () => {\n URL.revokeObjectURL(url);\n resolve(false);\n };\n\n (document.head || document.documentElement).appendChild(s);\n } catch {\n resolve(false);\n }\n });\n }\n\n function injectInlineWithNonce(code) {\n return new Promise((resolve) => {\n try {\n const nonceEl = document.querySelector(\"script[nonce]\");\n const pageNonce = nonceEl?.nonce || nonceEl?.getAttribute?.(\"nonce\") || \"\";\n if (!pageNonce) return resolve(false);\n\n // Inline + nonce (no reliable onload; we assume success if no sync error)\n const s = document.createElement(\"script\");\n s.setAttribute(\"nonce\", pageNonce);\n s.textContent = String(code);\n\n (document.head || document.documentElement).appendChild(s);\n\n // Give the browser a tick; if CSP blocked it, you’ll usually see a console error.\n setTimeout(() => resolve(true), 0);\n } catch {\n resolve(false);\n }\n });\n }\n\n /**\n * Main function to load and execute injection script\n */\n async function loadAndExecuteInjectionScript() {\n try {\n // Try to get provider ID from localStorage first\n let providerId = getProviderIdFromStorage();\n // const providerId = \"8f8f3def-7864-4dae-890d-9e95c5e45bec\"\n\n // If not found in localStorage, try to get from extension\n if (!providerId) {\n debug.info(\"Provider ID not found in localStorage, requesting from extension...\");\n providerId = await getProviderIdFromExtension();\n }\n\n if (!providerId) {\n debug.error(\"Cannot load injection script: Provider ID not found\");\n return;\n }\n\n // Fetch the injection script from localStorage\n const injectionScript = localStorage.getItem(\n `reclaimBrowserExtensionInjectionScript:${providerId}`,\n );\n\n if (!injectionScript) {\n debug.info(\"No injection script to execute\");\n return;\n }\n\n const providerData = {\n providerId: providerId,\n name: \"Unknown Provider\",\n };\n\n // Execute the fetched script\n // executeInjectionScript(injectionScript, providerData);\n executeInjectionScriptNoEval(injectionScript, providerData);\n } catch (error) {\n debug.error(\"Error in loadAndExecuteInjectionScript:\", error);\n }\n }\n\n /**\n * Initialize the injection script loader\n * Waits for DOM to be ready before executing\n */\n function initializeInjectionLoader() {\n if (document.readyState === \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", loadAndExecuteInjectionScript);\n } else {\n // DOM is already ready\n loadAndExecuteInjectionScript();\n }\n }\n\n // Expose utilities globally for debugging and external access\n window.reclaimInjectionLoader = {\n loadAndExecuteInjectionScript,\n getProviderIdFromStorage,\n getProviderIdFromExtension,\n fetchProviderInjectionScript,\n executeInjectionScriptNoEval,\n };\n\n // Initialize the loader\n debug.info(\"Reclaim Injection Script Loader initialized and injected successfully\");\n initializeInjectionLoader();\n})();\n"],"names":["cachedSetTimeout","cachedClearTimeout","process","module","exports","defaultSetTimout","Error","defaultClearTimeout","runTimeout","fun","setTimeout","e","call","this","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","length","concat","drainQueue","timeout","len","run","marker","runClearTimeout","Item","array","noop","nextTick","args","Array","arguments","i","push","prototype","apply","title","browser","env","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","name","binding","cwd","chdir","dir","umask","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","t","r","Symbol","n","iterator","o","toStringTag","c","Generator","u","Object","create","_regeneratorDefine2","f","p","y","G","v","a","d","bind","l","TypeError","done","value","GeneratorFunction","GeneratorFunctionPrototype","getPrototypeOf","setPrototypeOf","__proto__","displayName","_regenerator","w","m","defineProperty","_invoke","enumerable","configurable","writable","asyncGeneratorStep","Promise","resolve","then","_asyncToGenerator","_next","_throw","ownKeys","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","_defineProperty","_typeof","toPrimitive","String","Number","_toPrimitive","_toPropertyKey","window","Reclaim","__reclaimParams","ls","localStorage","getItem","JSON","parse","_unused","get","forEach","getOwnPropertyDescriptors","defineProperties","_objectSpread","_unused2","set","updatePublicData","obj","publicData","stringify","postMessage","action","data","console","error","canExpectManyClaims","flag","expectMany","_unused3","reportProviderError","msg","message","requestClaim","rdObject","getParametersSync","_unused4","addEventListener","source","_ref","parameters","setItem","_unused5","_unused6","BACKEND_URL","PROVIDER_API_ENDPOINT","providerId","debug","_console2","_len2","_key2","_console3","_len3","_key3","info","getProviderIdFromStorage","keyValue","getProviderIdFromExtension","handleMessage","event","removeEventListener","_fetchProviderInjectionScript","_callee","response","scriptContent","_t","_context","fetch","method","headers","ok","status","text","trim","script","providerData","executeInjectionScriptNoEval","_x2","_x3","_executeInjectionScriptNoEval","_callee2","_context2","injectViaBlob","injectInlineWithNonce","code","_nonceEl$getAttribute2","blob","Blob","type","url","URL","createObjectURL","s","document","createElement","src","async","nonceEl","querySelector","pageNonce","nonce","getAttribute","setAttribute","onload","revokeObjectURL","onerror","head","documentElement","appendChild","_unused9","_nonceEl$getAttribute3","textContent","_unused0","loadAndExecuteInjectionScript","_loadAndExecuteInjectionScript","_callee3","injectionScript","_t2","_context3","reclaimInjectionLoader","fetchProviderInjectionScript","_x","readyState"],"sourceRoot":""}