piratebayproxy/UnblockedPiratebayClean

Uncaught SyntaxError: '' string literal contains an unescaped line break main.js:2:138

sj64 opened this issue · 2 comments

sj64 commented

Hi, two issues actually. main.js won't load because of the above error, can't see anything wrong with the script. Running Firefox 78.0.1 on Ubuntu 18.04LTS.

Other issue is it's running on a sub-domain, I could create it in dns, but wondered if there's an easy fix in the domain detection code. e.g.
search.php is on my.domain**/xyz**/search.php, but as is, returns to my.domain/search.php with 404. In other words is there anywhere I can add the /xyz globally, rather than editing all the hardcoded abc.php links in all pages?

I'm unable to replicate the error. Did you modify the file or are you using the original?

I don't think a subdomain shouldn't affect the script.

If it's in a subfolder, you will need to modify the several absolute links in the php files and the three absolute links in the main.js file. You can either remove the leading slash to make it relative or add your subfolder and keep it absolute.

For example: <script src="/static/main.js"></script> could become <script src="static/main.js"></script> or <script src="/YourSubFolder/static/main.js"></script>

sj64 commented

Thanks for quick response.

I think the js issue is actually a problem with caching at my webserver. i.e. any edits I make to js scripts (only) seem to take up to a few hours to update, as clearing my local browser cache does not resolve this. I had tried editing main.js, then reverted it, then uploaded a fresh copy from repo to see if it fixed issue before posting. However the error above has disappeared itself this morning, presumably because the server cache has been refreshed.

Have done all the hardcode edits in php. Everything apart from search.php is working now, and I expect that to work once the suggested code edit to main.js actually updates.

Have queried my isp about this caching issue.