diff --git a/src/background/index.js b/src/background/index.js index 876dcf3e..a1eaf2d2 100644 --- a/src/background/index.js +++ b/src/background/index.js @@ -146,7 +146,7 @@ class RecordingController { } injectScript () { - chrome.tabs.executeScript({ file: 'content-script.js', allFrames: false }) + chrome.tabs.executeScript({ file: 'content-script.js', allFrames: true }) } } diff --git a/src/code-generator/CodeGenerator.js b/src/code-generator/CodeGenerator.js index 1d599e08..5a2bb901 100644 --- a/src/code-generator/CodeGenerator.js +++ b/src/code-generator/CodeGenerator.js @@ -63,7 +63,7 @@ export default class CodeGenerator { switch (action) { case 'keydown': - if (keyCode === 9) { + if (keyCode === 9) { // tab key this._blocks.push(this._handleKeyDown(selector, value, keyCode)) } break diff --git a/src/content-scripts/__tests__/forms.spec.js b/src/content-scripts/__tests__/forms.spec.js index d5794151..b9e11f59 100644 --- a/src/content-scripts/__tests__/forms.spec.js +++ b/src/content-scripts/__tests__/forms.spec.js @@ -7,7 +7,6 @@ let server let browser let page - describe('forms', () => { beforeAll(async (done) => { await runDist() diff --git a/src/content-scripts/index.js b/src/content-scripts/index.js index 6230989c..ba325208 100644 --- a/src/content-scripts/index.js +++ b/src/content-scripts/index.js @@ -6,6 +6,7 @@ class EventRecorder { this.eventLog = [] this.previousEvent = null this.dataAttribute = null + this.isTopFrame = (window.location === window.parent.location) } start () { @@ -26,7 +27,7 @@ class EventRecorder { _initializeRecorder () { const events = Object.values(eventsToRecord) if (!window.pptRecorderAddedControlListeners) { - this.addAllListeners(elementsToBindTo, events) + this.addAllListeners(events) window.pptRecorderAddedControlListeners = true } @@ -34,10 +35,12 @@ class EventRecorder { window.document.pptRecorderAddedControlListeners = true } - this.sendMessage({ control: 'event-recorder-started' }) - this.sendMessage({ control: 'get-current-url', href: window.location.href }) - this.sendMessage({ control: 'get-viewport-size', coordinates: { width: window.innerWidth, height: window.innerHeight } }) - console.debug('Puppeteer Recorder in-page EventRecorder started') + if (this.isTopFrame) { + this.sendMessage({ control: 'event-recorder-started' }) + this.sendMessage({ control: 'get-current-url', href: window.location.href }) + this.sendMessage({ control: 'get-viewport-size', coordinates: { width: window.innerWidth, height: window.innerHeight } }) + console.debug('Puppeteer Recorder in-page EventRecorder started') + } } addAllListeners (events) { diff --git a/src/popup/components/App.vue b/src/popup/components/App.vue index 9130dfc4..0c604822 100644 --- a/src/popup/components/App.vue +++ b/src/popup/components/App.vue @@ -43,11 +43,11 @@