support icon indicating copy to clipboard operation
support copied to clipboard

[Edit][Firefox] Error. Selection.getRangeAt: 0 is out of range.

Open MarkRH opened this issue 3 years ago • 9 comments

I happen to be using Firefox 100.0.1 and version 1.9 of the extension. The are some places where when I use the side-bar or context-menu to apply a BBC Code or HTML style to something I've highlighted I'll get this error dialog.

image

It does apply the changes to the text so that part still works. I just get this dialog on the bottom-right. One place this happens at is https://www.dslreports.com/forum/mozilla .

Other places I don't get error dialog.

Thanks, Mark H.

MarkRH avatar May 19 '22 21:05 MarkRH

Thank you for the report. The mentioned URL requires login to test. I will try to find out the reason.

erosman avatar May 20 '22 04:05 erosman

Thanks for looking at it. I'm trying to find something else that you don't need an account for.

MarkRH avatar May 20 '22 23:05 MarkRH

Thought I would mention that it also happens on Reddit. Note: I am still using the old style Reddit. My option to use the new Reddit is still unchecked.

MarkRH avatar May 25 '22 21:05 MarkRH

I am not registered at Reddit either.

erosman avatar May 26 '22 05:05 erosman

I found out the reason. I was trying it on google translate page and it happened. It happens when they are more than one frames (i.e. iframe) and the error comes from the other iframes.

I will see how I can eliminate the notice.

PS. I am traveling now and not at my usual location.

erosman avatar May 29 '22 12:05 erosman

Ahhh.. well, you being able to duplicate it is the first step. Have fun with your travels. :)

MarkRH avatar May 29 '22 14:05 MarkRH

I also get this message probably every time I use Edit

There was an error with the operation Error: Selection.getRangeAt: 0 is out of range

2024-05-29_17-07-34 copy

However, by issuing this error message, the Edit add-on is doing what it is supposed to do. I don't use the sidebar, but only the context menu and keyboard.

Mozilla Firefox 127.0b7 (64-bit) Edit 1.9 (January 17, 2023) Microsoft Windows 10.0.19045.4412

Korb avatar May 29 '24 14:05 Korb

Which pages are you trying it on? Some pages wont allow the operation due to the CSP (Content Security Policy).

However, above issue with CSP should be fixed in Firefox 128. ref: CSP 'sandbox' directive prevents content scripts from matching, due to unique origin, breaking also browser features

erosman avatar May 29 '24 16:05 erosman

Which pages are you trying it on?

In this case - CS-Cart CMS. Also, I can reproduce this error on the sites keep.google.com, calendar.google.com, messages.google.com, mail.google.com, mail.proton.me...

On Github, when performing the same actions, the error message does not appear.

Korb avatar May 29 '24 16:05 Korb