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-3

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={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}));
!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,(()=>{return e={44:function(e){var t;t=()=>(()=>{"use strict";var e={};return{607: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 o=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=o;var r=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 o;if(e.widgetLink)this.widgetLink=e.widgetLink;else{if(!e.siteKey)throw new o;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=r}}[607](0,e),e})(),e.exports=t()},607: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 o=n(44);Object.defineProperty(t,"ConfigurationError",{enumerable:!0,get:function(){return o.ConfigurationError}});var r=i(n(44));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 r.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 o="mcaptcha-widget__iframe",a=document.createElement("iframe");a.title="mCaptcha",a.src=this.receiver.widgetLink.toString(),a.ariaRoleDescription="presentation",a.name=o,a.id=o,a.scrolling="no";try{a.sandbox="allow-same-origin allow-scripts allow-popups"}catch(e){try{a.sandbox.add("allow-same-origin"),a.sandbox.add("allow-scripts"),a.sandbox.add("allow-popups")}catch(e){a.setAttribute("sandbox","allow-same-origin allow-scripts allow-popups")}}a.width="100%",a.height="100%",a.frameBorder="0",i.appendChild(a)}}},t={},function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,n),r.exports}(607);var e,t}));

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

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

@@ -77,4 +77,4 @@ "keywords": [

"dependencies": {
"@mcaptcha/core-glue": "^0.1.0-alpha-3"
"@mcaptcha/core-glue": "^0.1.0-alpha-5"
}
}