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

Custom recipe does not appear #97

Closed
9 tasks done
SierraKomodo opened this issue Dec 30, 2018 · 11 comments
Closed
9 tasks done

Custom recipe does not appear #97

SierraKomodo opened this issue Dec 30, 2018 · 11 comments
Labels
bug Something isn't working fixed issue has been addressed

Comments

@SierraKomodo
Copy link

Prerequisites

  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
  • 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
  • I used the logger to rule out that the issue is caused by my ruleset

Description

Similar to #8 - Except in my case I do have the ! uMatrix: Ruleset recipes 1.0 line present at the top of the file.

I'm putting together a custom ruleset recipe that currently only has a recipe for allowing youtube embeds to play (Using specific rules that are compatible with my global restrictions). This recipe does not appear as an option when opening the uMatrix panel on a webpage that contains a youtube embed with this custom recipe set enabled. The youtube recipe provided in the default english set appears to work fine.

A specific URL where the issue occurs

https://arstechnica.com/gaming/2018/12/the-orville-blends-science-fiction-and-science-fact-into-a-winning-mix/

Steps to Reproduce

  1. Create a ruleset recipe file containing the text contained under Ruleset
  2. Import this file into uMatrix in the Assets tab (My method was by uploading it to a private webserver and fetching the link from there.)
  3. Enable the ruleset
  4. Navigate to a webpage containing a youtube embed
  5. Open the uMatrix panel
  6. Note the puzzle icon is grayed out (Or missing the new youtube rule if you have another ruleset enabled).

Ruleset

! uMatrix: Ruleset recipes 1.0
! Title: Sierra Rulesets
! Maintainer: SierraKomodo

 Youtube Embeds
    * youtube.com
        _ googlevideo.com xhr
        _ youtube.com css
        _ youtube.com frame
        _ youtube.com script
        _ youtube.com xhr
        _ ytimg.com image

Supporting evidence

firefox_2018-12-29_18-55-13

firefox_2018-12-29_19-00-03

firefox_2018-12-29_18-59-21

Your environment

  • uMatrix version: 1.3.16
  • Browser Name and version: Firefox Quantum 64.0 (64-bit)
  • Operating System and version: Windows 10 Professional 64-bit
@uBlock-user
Copy link
Contributor

uBlock-user commented Dec 30, 2018

I uploaded your recipe over my uMatrix repository - https://raw.githubusercontent.com/uBlock-user/uMatrix-Hosts-List/master/recipes.txt

Works for me. You're doing something wrong.

@uBlock-user uBlock-user added the unable to reproduce cannot reproduce the given issue label Dec 30, 2018
@uBlock-user
Copy link
Contributor

Also the recipe is expected to follow the format of the existing recipes and be .txt file, instead of .urr.

@gorhill
Copy link
Member

gorhill commented Dec 30, 2018

I also cannot reproduce. I imported your recipes as is into "My recipes" and it showed up as available when when browsing to that ARS Technica page.

Does it work if you use @uBlock-user's list above?

@gorhill
Copy link
Member

gorhill commented Dec 30, 2018

be .txt file, instead of .urr.

As long as there is a valid responseText value in the response when fetching the file, it should work fine regardless of the extension.

@SierraKomodo
Copy link
Author

It does work when I use the recipe off @uBlock-user 's link - I'm not certain why it would not be working off my own server. I was originally using a .txt extension, before changing to .urr after seeing a repository that had that extension instead.

Could this be related to the server not actually having a domain, and the vpstunnel.ramnode.wan domain being something hardcoded in my hosts file?

@uBlock-user
Copy link
Contributor

The issue seems to be with your host. I tried your host too and it doesn't work.

@uBlock-user uBlock-user added the invalid Not a valid issue label Dec 31, 2018
@gorhill
Copy link
Member

gorhill commented Dec 31, 2018

Each recipe line must be \n-terminated. Is it possible your file had \r instead of \n?

@SierraKomodo
Copy link
Author

The file is \r\n terminated

@gorhill
Copy link
Member

gorhill commented Dec 31, 2018

If you can step into the code in the debugger, you might be able to find out why this fails. Since I can't reproduce, I can't investigate. This is where recipe file content is parsed:

https://github.com/gorhill/uMatrix/blob/6958c4ed26ab514cc1faf84d8f2ddf3be5f8cad5/src/js/recipe-manager.js#L97

@SierraKomodo
Copy link
Author

I believe I see where the issue lies:

https://github.com/gorhill/uMatrix/blob/6958c4ed26ab514cc1faf84d8f2ddf3be5f8cad5/src/js/recipe-manager.js#L32

https://github.com/gorhill/uMatrix/blob/6958c4ed26ab514cc1faf84d8f2ddf3be5f8cad5/src/js/recipe-manager.js#L102

As my file is \r\n terminated, it won't pass a check seeing if it matches /^! uMatrix: Ruleset recipes [0-9.]+\n/.

Should I file a new bug report regarding the \r\n vs \n issue, or have this one re-opened?

@gorhill gorhill reopened this Dec 31, 2018
@gorhill
Copy link
Member

gorhill commented Dec 31, 2018

Thanks for spotting the issue, will fix asap.

@uBlock-user uBlock-user added bug Something isn't working and removed invalid Not a valid issue labels Dec 31, 2018
gorhill added a commit to gorhill/uMatrix that referenced this issue Dec 31, 2018
@gorhill gorhill removed the unable to reproduce cannot reproduce the given issue label Dec 31, 2018
@uBlock-user uBlock-user added the fixed issue has been addressed label Jan 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

3 participants