noscript refuses to trust localhost

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: noscript refuses to trust localhost

Re: noscript refuses to trust localhost

by Giorgio Maone » Fri Mar 16, 2018 11:45 pm

Included the localhost exception in latest development build, likely will switch to classic's approach in 10.1.7.4.
v 10.1.7.3rc1
=============================================================
x Fixed infinite script count report loops on some sites
(thanks AuntyJack, @ALoss2 and others for reporting)
x Fixed localhost not being recognized as a domain (thanks
skriptimaahinen for patch)

x Fixed regression causing NOSCRIPT element and META refreshes
not to be emulated anymore on script-disabled pages (thanks
barbaz and fatboy for reporting)

Re: noscript refuses to trust localhost

by barbaz » Fri Mar 16, 2018 2:15 pm

This affects all no-dot domains, not just localhost.

NoScript Classic solved this by always showing only the full address for no-dot domains, regardless of the setting to show full addresses.

Re: noscript refuses to trust localhost

by skriptimaahinen » Fri Mar 16, 2018 12:15 pm

Turns out the empty line is supposed to be the domain line for the localhost, but since tld.js doesn't recognize localhost as valid top level domain, the line is left empty.

tld.js behaviour is bit odd though, as the next tests show:

input -> returns
"localhost" -> ""
"localhost:8000" -> ""
"http://localhost" -> ""
"http://localhost:8000" -> "http://localhost:8000"
"foo.localhost" -> "foo.localhost"
"foo.localhost:8000" -> "foo.localhost:8000"

Luckily there appears to be an easy fix for our problem. Simply add one line as shown below.

Code: Select all

tld.js

getDomain(domain) {
    if (domain == "localhost") return domain; // added line
    if (this.isIp(domain)) return domain;
    ...
This should be OK as long as getDomain is fed only hostnames, so the port number or protocol are not going to be issues. Alternatively you could get fancy with regexps, or update the tld.js. The newer version seems to have feature to import custom hostnames like localhost.

Re: noscript refuses to trust localhost

by frpatte » Thu Mar 15, 2018 2:07 pm

Ok! Thank you, this done the job.

F.P.

Re: noscript refuses to trust localhost

by skriptimaahinen » Thu Mar 15, 2018 11:26 am

Enabling "List full addresses in the permissions popup (https://www.noscript.net)" in the Appearance options makes the localhost line visible again.

The purpose of the empty line is unclear to me though.

noscript refuses to trust localhost

by frpatte » Thu Mar 15, 2018 9:56 am

Bonjour,

I am facing a problem, I can't access my dlna server on my own machine (localhost). I have the emby server installed on my computer and when I want to connect (localhost:8096), noscript blocks the access. If I try to mark the page as trusted, a small locker appears saying "match https content only". And I can't do anything to unlock this page.....

Thank you for helping.

F.P.

Top