Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

When pasting multiple lines into the rules editor they are joined together in a single line #64

Closed
7 tasks done
Taichocre006 opened this issue Sep 26, 2018 · 4 comments
Closed
7 tasks done
Labels
bug Something isn't working Firefox specific to Firefox fixed issue has been addressed

Comments

@Taichocre006
Copy link

Taichocre006 commented Sep 26, 2018

Prerequisites

  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
    • Your issue may already be reported.
  • This is not a support issue or a question
    • Support issues and questions are handled at /r/uMatrix
  • I tried to reproduce the issue when...
    • uMatrix is the only extension
    • uMatrix with default lists/settings
    • using a new, unmodified browser profile
  • I am running the latest version of uMatrix
  • I checked the documentation to understand that the issue I report is not a normal behavior

Description

When pasting multiple lines into the rules editor they are joined together in a single line. This makes it a pain to manage the ruleset. I keep a lot of temporary rules on text files and paste them/load the website/revert when required. It worked properly before the new editor component was added. Tested copying from various text editors, with both line termination standards (Windows and Unix).

Steps to Reproduce

  1. Open the rules editor.
  2. Click on the last line.
  3. Press enter.
  4. Paste
    google.com * block
    yahoo.com * block
  5. Instead of adding two lines, the following line will be added:
    google.com * block* yahoo.com * block

Your environment

  • uMatrix version: 1.3.14
  • Browser Name and version: FF ESR 60.2.0
  • Operating System and version: Win 7, 64 bits
@ghost
Copy link

ghost commented Sep 26, 2018

Your probably have dom.event.clipboardevents.enabled set to false in about:config

@gorhill
Copy link
Member

gorhill commented Sep 26, 2018

google.com * block
yahoo.com * block

You probably meant:

* google.com * block
* yahoo.com * block

As your rules are not valid and are rejected.

Using the valid rules, I could not reproduce.

However, I could reproduce after changing dom.event.clipboardevents.enabled to false, as pointed by @7b4a82cee25ea77cbf9f8250fcec650d.

Important: I could only reproduce when copying from a text area, not from directly copying the above.

The pasting of text is entirely handled by CodeMirror's editor, and from what's I've gathered, this also breaks other fancy editors which rely on clipboard events to work properly (example).

@gorhill
Copy link
Member

gorhill commented Sep 26, 2018

I was investigating for a fix in CodeMirror, and as I was preparing to create a patch, I found out somebody else already submitted such patch, codemirror/codemirror5#5383, so just updating with the latest CodeMirror library should fix the issue.

@gorhill
Copy link
Member

gorhill commented Sep 26, 2018

The whole time I thought I was dealing with a uBO issue... Anyways, this issue is valid for both uBO and uMatrix, so the fix is the same.

@gwarser gwarser added bug Something isn't working external an external factor is involved Firefox specific to Firefox labels Sep 26, 2018
gorhill added a commit to gorhill/uMatrix that referenced this issue Sep 26, 2018
@gwarser gwarser added fixed issue has been addressed and removed external an external factor is involved labels Sep 26, 2018
Noxgrim pushed a commit to Noxgrim/uMatrix that referenced this issue Dec 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Firefox specific to Firefox fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

3 participants