New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mcaptcha/vanilla-glue

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mcaptcha/vanilla-glue - npm Package Compare versions

Comparing version

to
0.1.0-alpha-2

2

dist/index.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.mcaptchaGlue=t():e.mcaptchaGlue=t()}(self,(function(){return e={245:e=>{self,e.exports=(()=>{"use strict";var e={607:function(e,t){var i,n=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationError=void 0;var r=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.message="Provide either widget link or site key to display mCaptcha widget",t}return n(t,e),t}(Error);t.ConfigurationError=r;var o=function(){function e(e,t){var i=this;if(this.handle=function(e){console.log("message received from "+e.origin+" with data: "+e.data.token),new URL(e.origin).host==i.widgetLink.host?i.updateState(e.data.token):console.error("expected message from "+i.widgetLink.host+" but received message from "+e.origin+". Aborting.")},this.updateState=t,e.widgetLink&&e.siteKey)throw new r;if(e.widgetLink)this.widgetLink=e.widgetLink;else{if(!e.siteKey)throw new r;e.siteKey.instanceUrl?(this.widgetLink=e.siteKey.instanceUrl,this.widgetLink.pathname="/widget/",this.widgetLink.search="?sitekey="+e.siteKey.key):this.widgetLink=new URL("https://demo.mcaptcha.org/widget/?sitekey="+e.siteKey.key)}}return e.prototype.listen=function(){window.addEventListener("message",this.handle)},e.prototype.destroy=function(){window.removeEventListener("message",this.handle)},e}();t.default=o}},t={};return e[607](0,t),t})()},851:function(e,t,i){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationError=t.ID=t.INPUT_NAME=void 0;var r=i(245);Object.defineProperty(t,"ConfigurationError",{enumerable:!0,get:function(){return r.ConfigurationError}});var o=n(i(245));t.INPUT_NAME="mcaptcha__token",t.ID="mcaptcha__widget-container";t.default=function(e){var i=this;this.setToken=function(e){return i.inputElement.value=e},this.receiver=new o.default(e,this.setToken),this.receiver.listen();var n=document.getElementById(t.ID);if(null==n)throw new Error("Element ".concat(t.ID,"'s parent element is undefined"));this.inputElement=document.createElement("input"),this.inputElement.id=t.INPUT_NAME,this.inputElement.name=t.INPUT_NAME,this.inputElement.hidden=!0,this.inputElement.required=!0,n.appendChild(this.inputElement);var r="mcaptcha-widget__iframe",s=document.createElement("iframe");s.title="mCaptcha",s.src=this.receiver.widgetLink.toString(),s.ariaRoleDescription="presentation",s.name=r,s.id=r,s.scrolling="no";try{s.sandbox="allow-same-origin allow-scripts"}catch(e){try{s.sandbox.add("allow-same-origin"),s.sandbox.add("allow-scripts")}catch(e){s.setAttribute("sandbox","allow-same-origin allow-scripts")}}s.width="304",s.height="78",s.frameBorder="0",n.appendChild(s)}}},t={},function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,i),o.exports}(851);var e,t}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.mcaptchaGlue=t():e.mcaptchaGlue=t()}(self,(function(){return e={326:function(e){e.exports=(()=>{"use strict";var e={851:function(e,t){var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationError=void 0;var r=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.message="Provide either widget link or site key to display mCaptcha widget",t}return i(t,e),t}(Error);t.ConfigurationError=r;var o=function(){function e(e,t){var n=this;if(this.handle=function(e){console.log("message received from ".concat(e.origin," with data: ").concat(e.data.token)),new URL(e.origin).host==n.widgetLink.host?n.updateState(e.data.token):console.error("expected message from ".concat(n.widgetLink.host," but received message from ").concat(e.origin,". Aborting."))},this.updateState=t,e.widgetLink&&e.siteKey)throw new r;if(e.widgetLink)this.widgetLink=e.widgetLink;else{if(!e.siteKey)throw new r;e.siteKey.instanceUrl?(this.widgetLink=e.siteKey.instanceUrl,this.widgetLink.pathname="/widget/",this.widgetLink.search="?sitekey=".concat(e.siteKey.key)):this.widgetLink=new URL("https://demo.mcaptcha.org/widget/?sitekey=".concat(e.siteKey.key))}}return e.prototype.listen=function(){window.addEventListener("message",this.handle)},e.prototype.destroy=function(){window.removeEventListener("message",this.handle)},e}();t.default=o}},t={};return e[851](0,t),t})()},669:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationError=t.ID=t.INPUT_NAME=void 0;var r=n(326);Object.defineProperty(t,"ConfigurationError",{enumerable:!0,get:function(){return r.ConfigurationError}});var o=i(n(326));t.INPUT_NAME="mcaptcha__token",t.ID="mcaptcha__widget-container";t.default=function(e){var n=this;this.setToken=function(e){return n.inputElement.value=e},this.receiver=new o.default(e,this.setToken),this.receiver.listen();var i=document.getElementById(t.ID);if(null==i)throw new Error("Element ".concat(t.ID,"'s parent element is undefined"));this.inputElement=document.createElement("input"),this.inputElement.id=t.INPUT_NAME,this.inputElement.name=t.INPUT_NAME,this.inputElement.hidden=!0,this.inputElement.required=!0,i.appendChild(this.inputElement);var r="mcaptcha-widget__iframe",a=document.createElement("iframe");a.title="mCaptcha",a.src=this.receiver.widgetLink.toString(),a.ariaRoleDescription="presentation",a.name=r,a.id=r,a.scrolling="no";try{a.sandbox="allow-same-origin allow-scripts"}catch(e){try{a.sandbox.add("allow-same-origin"),a.sandbox.add("allow-scripts")}catch(e){a.setAttribute("sandbox","allow-same-origin allow-scripts")}}a.width="100%",a.height="100%",a.frameBorder="0",i.appendChild(a)}}},t={},function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}(669);var e,t}));

@@ -5,3 +5,3 @@ {

"description": "glue code to setup mCaptcha on your website",
"version": "0.1.0-alpha-1",
"version": "0.1.0-alpha-2",
"license": "(MIT OR Apache-2.0)",

@@ -8,0 +8,0 @@ "keywords": [

@@ -21,3 +21,2 @@ <div align="center">

id="mcaptcha__widget-container"
style="width: 304px; height: 78px"
></div>

@@ -24,0 +23,0 @@ <script src="../dist/index.js"></script>