net::ERROR_BLOCKED_BY_CLIENT for JavaScript linked to by an HTML script element

In bootstrapping a web app deployed as a WASM file, a small amount of JavaScript is unfortunately still required.

That JavaScript is linked to by a script element in the HTML.

<head>
    <script src="safe://hbkygydwgx91wee8wqrtomddqj6ootdkp3kj13r5f3mt1n3pz31zn4y957" defer></script>
</head>

The resource is blocked with a console error message GET safe://hbkygydwgx91wee8wqrtomddqj6ootdkp3kj13r5f3mt1n3pz31zn4y957 net::ERR_BLOCKED_BY_CLIENT. The client version is SAFE Browser 0.15.4-beta.2.

How should the error be resolved?

Just an idea - try uploading the script along with your html and use a relative path to the script?

2 Likes

@latch This is expected, as it’s external +unversioned JS to the site. We’ve no way of detecting if that’s an NRS site (which means the content could change) or not at the mo, so that is automatically blocked.

Try uploading the JS in a relative directory to the HTML file, and ensure, if you’re using an NRS site that the NRS site version is updated to include this too.

That should then go :+1:

2 Likes

@joshuef

What is that?

Is there a more detailed explanation of that available? What I’m currently doing is uploading the WASM file and getting its xor-url, putting that xor-url in the JS file and uploading it to get a xor-url, putting that xor-url in the HTML file and uploading it to get a xor-url, and loading that xor-url in SAFE Browser.

1 Like

The CLI User Guide has a NRS section which explains it in detail: https://github.com/maidsafe/safe-api/blob/master/safe-cli/README.md#nrs-name-resolution-system

1 Like

This topic was automatically closed after 60 days. New replies are no longer allowed.