Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] qBit 4.3.2 theme break RSS tab #132

Closed
Sinderella opened this issue Dec 28, 2020 · 5 comments
Closed

[Bug] qBit 4.3.2 theme break RSS tab #132

Sinderella opened this issue Dec 28, 2020 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@Sinderella
Copy link

Sinderella commented Dec 28, 2020

Hello,

I just attempted to use a theme in qBit 4.3.2, but this message occurs whenever I applied one of the themes. The following error messages occur when I load the page itself.

Uncaught SyntaxError: '' string literal contains an unescaped line break

Full traces:
image

This renders RSS tab no longer accessible. When I click on the RSS tab, I get the following traces.

Uncaught TypeError: window.qBittorrent.Rss is undefined

Full traces:
image

My nginx config:

location /qbittorrent/ {
    proxy_pass              http://$remote_user.qbittorrent;
    proxy_http_version      1.1;
    proxy_set_header        X-Forwarded-Host        $http_host;
    http2_push_preload on; # Enable http2 push
    auth_basic "What's the password?";

    proxy_set_header Accept-Encoding "";
    sub_filter
    '</head>'
    '<link rel="stylesheet" type="text/css" href="https://gilbn.github.io/theme.park/CSS/themes/qbittorrent/space-gray.css">
    </head>';
    sub_filter_once on;

    proxy_hide_header   "x-webkit-csp";
    proxy_hide_header   "content-security-policy";

    auth_basic_user_file /etc/htpasswd;
    rewrite ^/qbittorrent/(.*) /$1 break;
}

Note that the RSS tab became accessible when I remove the sub_filter from nginx.

Please let me know if you need any more information. I did try to debug it but I never thought CSS could break the functionality, could be one of the unicodes?

Thank you for beautiful themes!

@Sinderella Sinderella changed the title [Bug] qBit theme break RSS tab [Bug] qBit 4.3.2 theme break RSS tab Dec 28, 2020
@GilbN GilbN added the duplicate This issue or pull request already exists label Dec 28, 2020
@Sinderella
Copy link
Author

@GilbN using sub_filter to replace <noscript> tag instead of the </head> tag fixed the issue for me. basically move the tag to group with other css files before javascript script tags.

@GilbN
Copy link
Collaborator

GilbN commented Dec 28, 2020

@GilbN using sub_filter to replace <noscript> tag instead of the </head> tag fixed the issue for me. basically move the tag to group with other css files before javascript script tags.

Awesome! @rg9400 can you try this?

@rg9400
Copy link
Contributor

rg9400 commented Dec 28, 2020

Yeah, this fixed the issue for me

@rcdailey
Copy link

rcdailey commented Dec 28, 2020

Can someone provide a verbatim theme-park.conf for this? I am not familiar with sub_filter, my attempt at this change did not work:

proxy_set_header Accept-Encoding "";
sub_filter
'<noscript>'
'<link rel="stylesheet" type="text/css" href="https://gilbn.github.io/theme.park/CSS/themes/$app/$theme.css">
<noscript>';
sub_filter_once on;

EDIT: Actually what I have above does work, however I would love confirmation from someone smarter than me regarding its correctness. The reason it wasn't working is because I was missing the two headers in the below corrected version, which I am keeping in my theme-park.conf file:

proxy_hide_header "x-webkit-csp";
proxy_hide_header "content-security-policy";
proxy_set_header Accept-Encoding "";
sub_filter
'<noscript>'
'<link rel="stylesheet" type="text/css" href="https://gilbn.github.io/theme.park/CSS/themes/$app/$theme.css">
<noscript>';
sub_filter_once on;

I'm assuming we want to globally handle theme park using this method, thus I have put it in theme-park.conf which affects all sites for my test. This needs some guidance as well...

EDIT 2: Nope, this doesn't work on all sites, so appears to be a specialized solution just for qbt. I tested nzbget and it is not themed if I use this solution.

@rg9400
Copy link
Contributor

rg9400 commented Dec 29, 2020

Yes, you want to keep those first two headers in qbt only. You also don't want to use this subfilter globally, so just hardcode it into qbt vs doing an include of teme-park.conf.

I have no idea why doing it at the end of the <head> tag causes issues. Possibly, something is happening to the tab elements via javascript now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants