diff --git a/package.json b/package.json index 0daf4f6..9d5e9a1 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "probely-record-sequence", - "version": "0.0.4", - "description": "Probely Record login/sequence", + "name": "snyk-api-and-web-record-sequence", + "version": "0.0.6", + "description": "Snyk API & Web Record login/sequence", "license": "MIT", "scripts": { "build": "node utils/build.js", diff --git a/src/assets/img/icon-128.png b/src/assets/img/icon-128.png index b090615..40eca3e 100644 Binary files a/src/assets/img/icon-128.png and b/src/assets/img/icon-128.png differ diff --git a/src/assets/img/icon-34-recording.png b/src/assets/img/icon-34-recording.png index 7f45dcd..a8eddcb 100644 Binary files a/src/assets/img/icon-34-recording.png and b/src/assets/img/icon-34-recording.png differ diff --git a/src/assets/img/icon-34.png b/src/assets/img/icon-34.png index 9e4650b..31164f7 100644 Binary files a/src/assets/img/icon-34.png and b/src/assets/img/icon-34.png differ diff --git a/src/assets/img/icon-48.png b/src/assets/img/icon-48.png index 04fddab..e641eac 100644 Binary files a/src/assets/img/icon-48.png and b/src/assets/img/icon-48.png differ diff --git a/src/assets/img/logo_probely.svg b/src/assets/img/logo_probely.svg index f2ddf86..084ca99 100644 --- a/src/assets/img/logo_probely.svg +++ b/src/assets/img/logo_probely.svg @@ -1,31 +1,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + diff --git a/src/manifest-chrome.json b/src/manifest-chrome.json index bbf1bd0..3752d7e 100755 --- a/src/manifest-chrome.json +++ b/src/manifest-chrome.json @@ -1,6 +1,6 @@ { "manifest_version": 3, - "name": "Probely Sequence Recorder", + "name": "Snyk API & Web Sequence Recorder", "action": { "default_popup": "popup.html", "default_icon": { diff --git a/src/manifest-firefox.json b/src/manifest-firefox.json index 2826968..065cfe3 100755 --- a/src/manifest-firefox.json +++ b/src/manifest-firefox.json @@ -1,6 +1,6 @@ { - "name": "Probely Sequence Recorder", - "version": "0.0.4", + "name": "Snyk API & Web Sequence Recorder", + "version": "0.0.5", "browser_specific_settings": { "gecko": { "id": "sequence-recorder@probely.com", diff --git a/src/manifest.json b/src/manifest.json index bbf1bd0..3752d7e 100755 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,6 +1,6 @@ { "manifest_version": 3, - "name": "Probely Sequence Recorder", + "name": "Snyk API & Web Sequence Recorder", "action": { "default_popup": "popup.html", "default_icon": { diff --git a/src/pages/Popup/Popup.jsx b/src/pages/Popup/Popup.jsx index b50e0cc..159958e 100644 --- a/src/pages/Popup/Popup.jsx +++ b/src/pages/Popup/Popup.jsx @@ -3,7 +3,7 @@ import logo from '../../assets/img/logo_probely.svg'; import help from '../../assets/img/help.svg'; import './Popup.css'; -const helpURL = 'https://help.probely.com/'; +const helpURL = 'https://help.probely.com/en/articles/5402869-how-to-record-a-sequence-with-probely-s-sequence-recorder-plugin'; const Popup = (props) => { // 🔴 @@ -146,7 +146,7 @@ const Popup = (props) => { type: "text/plain;charset=utf-8" }); var a = document.createElement('a'); - a.download = 'probely-recording.json'; + a.download = 'snyk-api-and-web-recording.json'; a.rel = 'noopener'; a.href = URL.createObjectURL(blob); try { @@ -181,7 +181,7 @@ const Popup = (props) => {

- Use this plugin to record a sequence of steps to be followed by Probely during a scan.{' '} + Use this plugin to record a sequence of steps to be followed by Snyk API & Web during a scan.{' '} When you finish recording, upload the script to your target settings.

diff --git a/src/pages/Review/Review.jsx b/src/pages/Review/Review.jsx index d79635b..d950f6b 100644 --- a/src/pages/Review/Review.jsx +++ b/src/pages/Review/Review.jsx @@ -103,7 +103,7 @@ const Review = (props) => { return; } const a = document.createElement('a'); - a.download = 'probely-recording.json'; + a.download = 'snyk-api-and-web-recording.json'; a.rel = 'noopener'; a.href = URL.createObjectURL(blob); try { @@ -255,7 +255,7 @@ const Review = (props) => {

- probely + Snyk API & Web

Sequence Recorder

@@ -285,7 +285,7 @@ const Review = (props) => { onChange={(ev) => { onChangeReviewAdvanced(ev); }} />
-

After saving your sequence, make sure to import it to your target settings at Probely, so it is followed during scans.

+

After saving your sequence, make sure to import it to your target settings at Snyk API & Web, so it is followed during scans.

:

No data has been recorded

}
diff --git a/src/pages/Start/Start.jsx b/src/pages/Start/Start.jsx index 942c592..5424f9e 100644 --- a/src/pages/Start/Start.jsx +++ b/src/pages/Start/Start.jsx @@ -6,7 +6,7 @@ const Start = (props) => {
- probely + Snyk API & Web

Sequence Recorder

diff --git a/test-build-firefox/8867f464cc4dd91227f8.svg b/test-build-firefox/8867f464cc4dd91227f8.svg deleted file mode 100644 index f2ddf86..0000000 --- a/test-build-firefox/8867f464cc4dd91227f8.svg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test-build-firefox/8ed204157dcedddc56f2.png b/test-build-firefox/8ed204157dcedddc56f2.png deleted file mode 100644 index 9e4650b..0000000 Binary files a/test-build-firefox/8ed204157dcedddc56f2.png and /dev/null differ diff --git a/test-build-firefox/e1ff029ad955c8c1a09d.png b/test-build-firefox/e1ff029ad955c8c1a09d.png deleted file mode 100644 index b090615..0000000 Binary files a/test-build-firefox/e1ff029ad955c8c1a09d.png and /dev/null differ diff --git a/test-build-firefox/icon-128.png b/test-build-firefox/icon-128.png index b090615..40eca3e 100644 Binary files a/test-build-firefox/icon-128.png and b/test-build-firefox/icon-128.png differ diff --git a/test-build-firefox/icon-34.png b/test-build-firefox/icon-34.png index 9e4650b..31164f7 100644 Binary files a/test-build-firefox/icon-34.png and b/test-build-firefox/icon-34.png differ diff --git a/test-build-firefox/icon-48.png b/test-build-firefox/icon-48.png index 04fddab..e641eac 100644 Binary files a/test-build-firefox/icon-48.png and b/test-build-firefox/icon-48.png differ diff --git a/test-build-firefox/manifest.json b/test-build-firefox/manifest.json index 2826968..065cfe3 100644 --- a/test-build-firefox/manifest.json +++ b/test-build-firefox/manifest.json @@ -1,6 +1,6 @@ { - "name": "Probely Sequence Recorder", - "version": "0.0.4", + "name": "Snyk API & Web Sequence Recorder", + "version": "0.0.5", "browser_specific_settings": { "gecko": { "id": "sequence-recorder@probely.com", diff --git a/test-build-firefox/popup.bundle.js b/test-build-firefox/popup.bundle.js index c4c654c..fd23c0e 100644 --- a/test-build-firefox/popup.bundle.js +++ b/test-build-firefox/popup.bundle.js @@ -27,4 +27,4 @@ var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),l=Symbol.for("rea * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -function n(e,t){var n=e.length;e.push(t);e:for(;0>>1,l=e[r];if(!(0>>1;ra(i,n))sa(c,i)?(e[r]=c,e[s]=n,r=s):(e[r]=i,e[u]=n,r=u);else{if(!(sa(c,n)))break e;e[r]=c,e[s]=n,r=s}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var u=Date,i=u.now();t.unstable_now=function(){return u.now()-i}}var s=[],c=[],f=1,d=null,p=3,m=!1,h=!1,g=!1,v="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var t=r(c);null!==t;){if(null===t.callback)l(c);else{if(!(t.startTime<=e))break;l(c),t.sortIndex=t.expirationTime,n(s,t)}t=r(c)}}function k(e){if(g=!1,w(e),!h)if(null!==r(s))h=!0,F(S);else{var t=r(c);null!==t&&R(k,t.startTime-e)}}function S(e,n){h=!1,g&&(g=!1,y(_),_=-1),m=!0;var a=p;try{for(w(n),d=r(s);null!==d&&(!(d.expirationTime>n)||e&&!z());){var o=d.callback;if("function"==typeof o){d.callback=null,p=d.priorityLevel;var u=o(d.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?d.callback=u:d===r(s)&&l(s),w(n)}else l(s);d=r(s)}if(null!==d)var i=!0;else{var f=r(c);null!==f&&R(k,f.startTime-n),i=!1}return i}finally{d=null,p=a,m=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var x,E=!1,C=null,_=-1,N=5,P=-1;function z(){return!(t.unstable_now()-Pe||125o?(e.sortIndex=a,n(c,e),null===r(s)&&e===r(c)&&(g?(y(_),_=-1):g=!0,R(k,a-o))):(e.sortIndex=u,n(s,e),h||m||(h=!0,F(S))),e},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},982:(e,t,n)=>{e.exports=n(463)},72:e=>{var t=[];function n(e){for(var n=-1,r=0;r{var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},159:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},56:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var l=void 0!==n.layer;l&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,l&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function n(r){var l=t[r];if(void 0!==l)return l.exports;var a=t[r]={id:r,exports:{}};return e[r](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.p="/",n.nc=void 0;var r=n(540),l=n(961);const a=n.p+"8867f464cc4dd91227f8.svg",o=n.p+"d2b15a3067409e19ad1e.svg";var u=n(72),i=n.n(u),s=n(825),c=n.n(s),f=n(659),d=n.n(f),p=n(56),m=n.n(p),h=n(159),g=n.n(h),v=n(113),y=n.n(v),b=n(346),w={};w.styleTagTransform=y(),w.setAttributes=m(),w.insert=d().bind(null,"head"),w.domAPI=c(),w.insertStyleElement=g();i()(b.A,w);b.A&&b.A.locals&&b.A.locals;const k="https://help.probely.com/",S=e=>{const[t,n]=(0,r.useState)(!1),[l,u]=(0,r.useState)(""),[i,s]=(0,r.useState)([]),[c,f]=(0,r.useState)({status:!1,error:!1,msg:"Successfully copied to clipboard"});function d(){chrome.runtime.sendMessage({messageType:"give_recording_data"})}function p(e,t){n(t),!0===t?(s([]),chrome&&((chrome.action||chrome.browserAction).setBadgeText({text:"🔴"},(()=>{})),chrome.storage.sync.set({isRecording:!0},(()=>{chrome.runtime.sendMessage({messageType:"start",event:{type:"goto",timestamp:(new Date).getTime(),windowWidth:null,windowHeight:null,url:l}}),chrome.tabs.create({active:!0,url:l},(e=>{}))})))):(e&&e.preventDefault(),chrome&&((chrome.action||chrome.browserAction).setBadgeText({text:""},(()=>{})),chrome.storage.sync.set({isRecording:!1},(()=>{d(),chrome.tabs.query({active:!0,currentWindow:!0},(e=>{if(e&&e.length){const t=e[0];chrome.tabs.remove(t.id),chrome.tabs.create({active:!0,url:"./review.html"},(e=>{}))}}))}))))}return(0,r.useEffect)((()=>{chrome&&chrome.storage&&(chrome.storage.sync.get(["isRecording"],(e=>{e.isRecording?(n(!0),(chrome.action||chrome.browserAction).setBadgeText({text:"🔴"},(()=>{}))):(n(!1),(chrome.action||chrome.browserAction).setBadgeText({text:""},(()=>{})))})),chrome.runtime.onMessage.addListener(((e,t,n)=>{"recording_data"===e.messageType&&s(e.recordingData||[])})),d())}),[]),r.createElement("div",{className:"App"},r.createElement("header",{className:"App-header"},r.createElement("img",{src:a,className:"App-logo",alt:"logo"}),r.createElement("h1",{className:"App-title"},"Sequence Recorder")),r.createElement("div",{className:"App-container"},r.createElement("p",null,"Use this plugin to record a sequence of steps to be followed by Probely during a scan."," ","When you finish recording, upload the script to your target settings."),r.createElement("p",{className:"help-container"},r.createElement("a",{href:k,className:"help-link",rel:"noreferrer",onClick:e=>{!function(e){e.preventDefault(),chrome.tabs.create({active:!0,url:k},(e=>{}))}(e)}},"Usage instructions ",r.createElement("img",{src:o,className:"help-logo",alt:"Help"})))),r.createElement("form",{method:"post",action:"#",className:"url-form",onSubmit:e=>{!function(e){e.preventDefault(),l&&p(null,!0)}(e)}},r.createElement("div",{className:"input-url-container"},t?null:r.createElement(r.Fragment,null,r.createElement("label",{className:"start_url_label",htmlFor:"start_url"},"Type the start URL to be recorded"),r.createElement("input",{type:"url",name:"start_url",id:"start_url",required:!0,className:"start-url",placeholder:"https://your-target-url.com/",autoComplete:"off",pattern:"^https?://.*",onChange:e=>{!function(e){const t=e.target;u(t.value)}(e)},value:l}))),r.createElement("div",{className:"buttons-container"},t?r.createElement("p",null,r.createElement("a",{href:"#",className:"App-button",onClick:e=>{p(e,!1)}},"Stop recording")):r.createElement("button",{type:"submit",className:"App-button"},i.length?"Start new recording":"Start recording"))),!t&&i.length?r.createElement(r.Fragment,null,r.createElement("div",{className:"buttons-container"},r.createElement("button",{type:"button",className:"App-button",onClick:()=>{!function(){const e=document.getElementById("input-copy-to-clipboard");if(e){e.select();const t=e.value;let n=!1;try{n=document.execCommand("copy")}catch(e){try{window.clipboardData.setData("text",t),n=!0}catch(e){}}n?(f({status:!0,error:!1,msg:"Successfully copied to clipboard"}),setTimeout((()=>{f({status:!1,error:!1,msg:""})}),3e3)):(f({status:!0,error:!0,msg:"Error on copy to clipboard"}),setTimeout((()=>{f({status:!1,error:!1,msg:""})}),5e3))}}()}},"Copy to clipboard")),r.createElement("div",{className:"buttons-container"},r.createElement("button",{type:"button",className:"App-button",onClick:()=>{!function(){var e=new Blob([JSON.stringify(i,null,2)],{type:"text/plain;charset=utf-8"}),t=document.createElement("a");t.download="probely-recording.json",t.rel="noopener",t.href=URL.createObjectURL(e);try{t.dispatchEvent(new MouseEvent("click"))}catch(e){var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}()}},"Download")),r.createElement("div",{className:"buttons-container"},r.createElement("button",{type:"button",className:"App-button App-button-secondary",onClick:()=>{chrome&&(chrome.runtime.sendMessage({messageType:"clear"}),s([]))}},"Clear recording data"))):null,r.createElement("div",{className:"copy-status-container"},c.status?r.createElement("div",{className:c.error?"copy-status error":"copy-status success"},c.msg):null),i.length?r.createElement("textarea",{id:"input-copy-to-clipboard",defaultValue:JSON.stringify(i,null,2)}):null)};var x=n(812),E={};E.styleTagTransform=y(),E.setAttributes=m(),E.insert=d().bind(null,"head"),E.domAPI=c(),E.insertStyleElement=g();i()(x.A,E);x.A&&x.A.locals&&x.A.locals;(0,l.render)(r.createElement(S,null),window.document.querySelector("#app-container"))})(); \ No newline at end of file +function n(e,t){var n=e.length;e.push(t);e:for(;0>>1,l=e[r];if(!(0>>1;ra(i,n))sa(c,i)?(e[r]=c,e[s]=n,r=s):(e[r]=i,e[u]=n,r=u);else{if(!(sa(c,n)))break e;e[r]=c,e[s]=n,r=s}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var u=Date,i=u.now();t.unstable_now=function(){return u.now()-i}}var s=[],c=[],f=1,d=null,p=3,m=!1,h=!1,g=!1,v="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var t=r(c);null!==t;){if(null===t.callback)l(c);else{if(!(t.startTime<=e))break;l(c),t.sortIndex=t.expirationTime,n(s,t)}t=r(c)}}function k(e){if(g=!1,w(e),!h)if(null!==r(s))h=!0,F(S);else{var t=r(c);null!==t&&R(k,t.startTime-e)}}function S(e,n){h=!1,g&&(g=!1,y(_),_=-1),m=!0;var a=p;try{for(w(n),d=r(s);null!==d&&(!(d.expirationTime>n)||e&&!z());){var o=d.callback;if("function"==typeof o){d.callback=null,p=d.priorityLevel;var u=o(d.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?d.callback=u:d===r(s)&&l(s),w(n)}else l(s);d=r(s)}if(null!==d)var i=!0;else{var f=r(c);null!==f&&R(k,f.startTime-n),i=!1}return i}finally{d=null,p=a,m=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var x,E=!1,C=null,_=-1,N=5,P=-1;function z(){return!(t.unstable_now()-Pe||125o?(e.sortIndex=a,n(c,e),null===r(s)&&e===r(c)&&(g?(y(_),_=-1):g=!0,R(k,a-o))):(e.sortIndex=u,n(s,e),h||m||(h=!0,F(S))),e},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},982:(e,t,n)=>{e.exports=n(463)},72:e=>{var t=[];function n(e){for(var n=-1,r=0;r{var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},159:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},56:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var l=void 0!==n.layer;l&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,l&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function n(r){var l=t[r];if(void 0!==l)return l.exports;var a=t[r]={id:r,exports:{}};return e[r](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.p="/",n.nc=void 0;var r=n(540),l=n(961);const a=n.p+"adc8b34de96d4007231c.svg",o=n.p+"d2b15a3067409e19ad1e.svg";var u=n(72),i=n.n(u),s=n(825),c=n.n(s),f=n(659),d=n.n(f),p=n(56),m=n.n(p),h=n(159),g=n.n(h),v=n(113),y=n.n(v),b=n(346),w={};w.styleTagTransform=y(),w.setAttributes=m(),w.insert=d().bind(null,"head"),w.domAPI=c(),w.insertStyleElement=g();i()(b.A,w);b.A&&b.A.locals&&b.A.locals;const k="https://help.probely.com/en/articles/5402869-how-to-record-a-sequence-with-probely-s-sequence-recorder-plugin",S=e=>{const[t,n]=(0,r.useState)(!1),[l,u]=(0,r.useState)(""),[i,s]=(0,r.useState)([]),[c,f]=(0,r.useState)({status:!1,error:!1,msg:"Successfully copied to clipboard"});function d(){chrome.runtime.sendMessage({messageType:"give_recording_data"})}function p(e,t){n(t),!0===t?(s([]),chrome&&((chrome.action||chrome.browserAction).setBadgeText({text:"🔴"},(()=>{})),chrome.storage.sync.set({isRecording:!0},(()=>{chrome.runtime.sendMessage({messageType:"start",event:{type:"goto",timestamp:(new Date).getTime(),windowWidth:null,windowHeight:null,url:l}}),chrome.tabs.create({active:!0,url:l},(e=>{}))})))):(e&&e.preventDefault(),chrome&&((chrome.action||chrome.browserAction).setBadgeText({text:""},(()=>{})),chrome.storage.sync.set({isRecording:!1},(()=>{d(),chrome.tabs.query({active:!0,currentWindow:!0},(e=>{if(e&&e.length){const t=e[0];chrome.tabs.remove(t.id),chrome.tabs.create({active:!0,url:"./review.html"},(e=>{}))}}))}))))}return(0,r.useEffect)((()=>{chrome&&chrome.storage&&(chrome.storage.sync.get(["isRecording"],(e=>{e.isRecording?(n(!0),(chrome.action||chrome.browserAction).setBadgeText({text:"🔴"},(()=>{}))):(n(!1),(chrome.action||chrome.browserAction).setBadgeText({text:""},(()=>{})))})),chrome.runtime.onMessage.addListener(((e,t,n)=>{"recording_data"===e.messageType&&s(e.recordingData||[])})),d())}),[]),r.createElement("div",{className:"App"},r.createElement("header",{className:"App-header"},r.createElement("img",{src:a,className:"App-logo",alt:"logo"}),r.createElement("h1",{className:"App-title"},"Sequence Recorder")),r.createElement("div",{className:"App-container"},r.createElement("p",null,"Use this plugin to record a sequence of steps to be followed by Snyk API & Web during a scan."," ","When you finish recording, upload the script to your target settings."),r.createElement("p",{className:"help-container"},r.createElement("a",{href:k,className:"help-link",rel:"noreferrer",onClick:e=>{!function(e){e.preventDefault(),chrome.tabs.create({active:!0,url:k},(e=>{}))}(e)}},"Usage instructions ",r.createElement("img",{src:o,className:"help-logo",alt:"Help"})))),r.createElement("form",{method:"post",action:"#",className:"url-form",onSubmit:e=>{!function(e){e.preventDefault(),l&&p(null,!0)}(e)}},r.createElement("div",{className:"input-url-container"},t?null:r.createElement(r.Fragment,null,r.createElement("label",{className:"start_url_label",htmlFor:"start_url"},"Type the start URL to be recorded"),r.createElement("input",{type:"url",name:"start_url",id:"start_url",required:!0,className:"start-url",placeholder:"https://your-target-url.com/",autoComplete:"off",pattern:"^https?://.*",onChange:e=>{!function(e){const t=e.target;u(t.value)}(e)},value:l}))),r.createElement("div",{className:"buttons-container"},t?r.createElement("p",null,r.createElement("a",{href:"#",className:"App-button",onClick:e=>{p(e,!1)}},"Stop recording")):r.createElement("button",{type:"submit",className:"App-button"},i.length?"Start new recording":"Start recording"))),!t&&i.length?r.createElement(r.Fragment,null,r.createElement("div",{className:"buttons-container"},r.createElement("button",{type:"button",className:"App-button",onClick:()=>{!function(){const e=document.getElementById("input-copy-to-clipboard");if(e){e.select();const t=e.value;let n=!1;try{n=document.execCommand("copy")}catch(e){try{window.clipboardData.setData("text",t),n=!0}catch(e){}}n?(f({status:!0,error:!1,msg:"Successfully copied to clipboard"}),setTimeout((()=>{f({status:!1,error:!1,msg:""})}),3e3)):(f({status:!0,error:!0,msg:"Error on copy to clipboard"}),setTimeout((()=>{f({status:!1,error:!1,msg:""})}),5e3))}}()}},"Copy to clipboard")),r.createElement("div",{className:"buttons-container"},r.createElement("button",{type:"button",className:"App-button",onClick:()=>{!function(){var e=new Blob([JSON.stringify(i,null,2)],{type:"text/plain;charset=utf-8"}),t=document.createElement("a");t.download="snyk-api-and-web-recording.json",t.rel="noopener",t.href=URL.createObjectURL(e);try{t.dispatchEvent(new MouseEvent("click"))}catch(e){var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}()}},"Download")),r.createElement("div",{className:"buttons-container"},r.createElement("button",{type:"button",className:"App-button App-button-secondary",onClick:()=>{chrome&&(chrome.runtime.sendMessage({messageType:"clear"}),s([]))}},"Clear recording data"))):null,r.createElement("div",{className:"copy-status-container"},c.status?r.createElement("div",{className:c.error?"copy-status error":"copy-status success"},c.msg):null),i.length?r.createElement("textarea",{id:"input-copy-to-clipboard",defaultValue:JSON.stringify(i,null,2)}):null)};var x=n(812),E={};E.styleTagTransform=y(),E.setAttributes=m(),E.insert=d().bind(null,"head"),E.domAPI=c(),E.insertStyleElement=g();i()(x.A,E);x.A&&x.A.locals&&x.A.locals;(0,l.render)(r.createElement(S,null),window.document.querySelector("#app-container"))})(); \ No newline at end of file diff --git a/test-build-firefox/reviewpage.bundle.js b/test-build-firefox/reviewpage.bundle.js index e0844f0..2bf2dbb 100644 --- a/test-build-firefox/reviewpage.bundle.js +++ b/test-build-firefox/reviewpage.bundle.js @@ -7,7 +7,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n