diff --git a/components/snapshot.form.tsx b/components/snapshot.form.tsx index 56f93e0..ab5ccb3 100644 --- a/components/snapshot.form.tsx +++ b/components/snapshot.form.tsx @@ -40,6 +40,11 @@ SnapshotForm.Options = function () { }]} name={["options","enable-javascript"]} label="Enable Javascript" > + + + diff --git a/contents/mutation-observer.tsx b/contents/mutation-observer.tsx index e825488..5ac1ef3 100644 --- a/contents/mutation-observer.tsx +++ b/contents/mutation-observer.tsx @@ -55,13 +55,11 @@ export default function SnapshotModal() { useEffect(() => { const onCapture = () => { if (event) { - console.log('mutation-observer','capture emitted') CaptureSnapshot(preferences.defaultSnapshotOptions, undefined, event) SetEvent(undefined) } } eventEmitter.on('capture', onCapture) - console.log('Captur registered') return () => { eventEmitter.off('capture', onCapture) } @@ -75,7 +73,6 @@ export default function SnapshotModal() { } if (autoCapture) { if (e.type == 'load') { - console.log('mutation-observer','load emitted') CaptureSnapshot(preferences.defaultSnapshotOptions, undefined, event) } else { observer.observe(window.document, observerOptions) diff --git a/contents/percy-dom.tsx b/contents/percy-dom.tsx index 2d37cac..0203276 100644 --- a/contents/percy-dom.tsx +++ b/contents/percy-dom.tsx @@ -20,7 +20,7 @@ export default function SnapshotModal() { await CaptureSnapshot(options,req.body?.name) res.send({ success: true }) } catch (err) { - console.log(err) + console.error(err) res.send({ success: false, error: err }) } } diff --git a/options/index.tsx b/options/index.tsx index 3d300f8..7417c45 100644 --- a/options/index.tsx +++ b/options/index.tsx @@ -15,7 +15,6 @@ export default function ChromeExtensionOptions() { const [discoveryOptions] = Form.useForm() const [preferences] = useLocalStorage('preferences') useEffect(() => { - console.log(preferences) if (preferences) { snapshotOptions.setFieldsValue({ options: preferences.defaultSnapshotOptions }) discoveryOptions.setFieldsValue(preferences.discoveryOptions) diff --git a/package.json b/package.json index fb3de5d..b0870fc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "percy-extension", "displayName": "Percy Web Extension", - "version": "0.0.2", + "version": "0.0.3", "description": "Percy Web Extension", "author": "BrowserStack Pvt Ltd", "scripts": { diff --git a/schemas/snapshot.ts b/schemas/snapshot.ts index d0969cf..7b14225 100644 --- a/schemas/snapshot.ts +++ b/schemas/snapshot.ts @@ -5,7 +5,8 @@ export const SnapshotOptionsSchema = z.object({ "min-height": z.string().default("1024"), "percy-css": z.string().optional(), "scope": z.string().optional(), - "enable-javascript": z.boolean().default(false) + "enable-javascript": z.boolean().default(false), + "enable-layout":z.boolean().default(false) }) export const SnapshotSchema = z.object({ dom: z.any(), @@ -14,7 +15,8 @@ export const SnapshotSchema = z.object({ })).default({ widths: [375, 1280], "min-height": "1024", - "enable-javascript": false + "enable-javascript": false, + "enable-layout": false }), url: z.string().url(), headers: z.record(z.string()).optional(), diff --git a/tabs/snapshots.tsx b/tabs/snapshots.tsx index 4f6eaa2..57db470 100644 --- a/tabs/snapshots.tsx +++ b/tabs/snapshots.tsx @@ -22,7 +22,6 @@ export default function SnapshotsList() { }, updateSnapshot: () => { form.validateFields().then(({ options,name }) => { - console.log(options) const snapshot = build.snapshots[modalOpen.name] if (snapshot) { snapshot.options = options @@ -52,7 +51,6 @@ export default function SnapshotsList() { Percy.clearBuild() }, openPreview: (snapshot: Snapshot) => { - console.log(snapshot.dom) var newWindow = window.open(""); newWindow.document.write(snapshot.dom.html) } diff --git a/utils/percy-utils.ts b/utils/percy-utils.ts index 569a239..734824a 100644 --- a/utils/percy-utils.ts +++ b/utils/percy-utils.ts @@ -90,7 +90,6 @@ export class Percy { percyConfig['percy'] = { token: build.token } - console.log(percyConfig) return fetch(`${appUrl}/percy/start`, { method: 'POST', headers: { @@ -98,7 +97,6 @@ export class Percy { }, body: JSON.stringify(percyConfig) }).then((res) => { - res.text().then(console.log) return res.status == 200 }).catch((err) => { return false @@ -133,6 +131,7 @@ export class Percy { widths: snapshot.options.widths?.map((w) => Number(w)).filter((w) => !Number.isNaN(w)), minHeight: Number(snapshot.options["min-height"] || 0), enableJavaScript: snapshot.options["enable-javascript"], + enableLayout: snapshot.options['enable-layout'], requestHeaders: snapshot.headers } try { @@ -147,13 +146,12 @@ export class Percy { if (errors.length == 0) { await Percy.clearBuild() } - console.log(running) chrome.tabs.create({ url: buildInfo?.build?.url }) return true; } catch (err) { - console.log(err) + console.error(err) return false } finally { await LocalStorage.set('finalizing', false)