Skip to content

Commit 07201ce

Browse files
committed
v1.2.1 - Improve checkbox event. Update example file
1 parent b33cd25 commit 07201ce

8 files changed

Lines changed: 27 additions & 12 deletions

File tree

OUTPUT-EXAMPLE.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Result Example
1+
# Output Example
22

33
JSON example containing all possible step types produced by the sequence recorder.
44

@@ -124,6 +124,14 @@ JSON example containing all possible step types produced by the sequence recorde
124124
"type": "click",
125125
"value": "Submit",
126126
"frame": "#content-iframe"
127+
},
128+
{
129+
"timestamp": 1718724013000,
130+
"css": ".nested-btn",
131+
"xpath": "/html/body/div/button",
132+
"type": "click",
133+
"value": "Confirm",
134+
"frame": "#outer-iframe >>> #inner-iframe"
127135
}
128136
]
129137
```
@@ -153,4 +161,4 @@ JSON example containing all possible step types produced by the sequence recorde
153161
| `xpath` | XPath selector for the target element |
154162
| `type` | Event type identifier |
155163
| `value` | Element value or trimmed text content (max 20 chars for clicks) |
156-
| `frame` | CSS selector of the containing iframe, empty string if top-level |
164+
| `frame` | CSS selector of the containing iframe, empty string if top-level. For nested iframes, selectors are joined with ` >>> ` from outermost to innermost (e.g. `#outer-iframe >>> #inner-iframe`) |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "snyk-api-and-web-record-sequence",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Snyk API & Web Record login/sequence",
55
"license": "MIT",
66
"scripts": {

src/manifest-firefox.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Snyk API & Web Sequence Recorder",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"browser_specific_settings": {
55
"gecko": {
66
"id": "sequence-recorder@probely.com",

src/pages/Content/modules/collectEvents.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,17 @@ export function interceptEvents(event, doc, ifrSelector, callback) {
199199
) {
200200
return;
201201
}
202-
if (nodeName === 'label') {
203-
const forAttr = tgt.getAttribute('for');
204-
if (forAttr && document.getElementById(forAttr)) {
205-
// can be ignored... will fire checkbox
202+
const parentLabel = tgt.closest && tgt.closest('label');
203+
if (parentLabel) {
204+
const forAttr = parentLabel.getAttribute('for');
205+
if (forAttr) {
206+
const forEl = document.getElementById(forAttr);
207+
if (forEl && forEl.nodeName.toLowerCase() === 'input' &&
208+
(forEl.type === 'checkbox' || forEl.type === 'radio')) {
209+
return;
210+
}
211+
}
212+
if (parentLabel.querySelector('input[type="checkbox"], input[type="radio"]')) {
206213
return;
207214
}
208215
}

test-build-firefox/contentScript.bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-build-firefox/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Snyk API & Web Sequence Recorder",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"browser_specific_settings": {
55
"gecko": {
66
"id": "sequence-recorder@probely.com",

test-build/contentScript.bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-build/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"1.2.0","manifest_version":3,"name":"Snyk API & Web Sequence Recorder","action":{"default_popup":"popup.html","default_icon":{"16":"icon-34.png","48":"icon-48.png"}},"icons":{"128":"icon-128.png"},"background":{"service_worker":"background.bundle.js"},"content_scripts":[{"matches":["http://*/*","https://*/*"],"js":["contentScript.bundle.js"],"css":["content.styles.css"],"run_at":"document_start","all_frames":true,"match_about_blank":true}],"web_accessible_resources":[{"resources":["content.styles.css","icon-128.png","icon-34.png"],"matches":["<all_urls>"]}],"permissions":["storage","activeTab"],"host_permissions":["http://*/*","https://*/*"]}
1+
{"version":"1.2.1","manifest_version":3,"name":"Snyk API & Web Sequence Recorder","action":{"default_popup":"popup.html","default_icon":{"16":"icon-34.png","48":"icon-48.png"}},"icons":{"128":"icon-128.png"},"background":{"service_worker":"background.bundle.js"},"content_scripts":[{"matches":["http://*/*","https://*/*"],"js":["contentScript.bundle.js"],"css":["content.styles.css"],"run_at":"document_start","all_frames":true,"match_about_blank":true}],"web_accessible_resources":[{"resources":["content.styles.css","icon-128.png","icon-34.png"],"matches":["<all_urls>"]}],"permissions":["storage","activeTab"],"host_permissions":["http://*/*","https://*/*"]}

0 commit comments

Comments
 (0)