jacobwb / hashover-next

This branch will be HashOver 2.0
GNU Affero General Public License v3.0
420 stars 87 forks source link

localhost access to HashOver during the development of a website #301

Open myFrank-wk opened 3 years ago

myFrank-wk commented 3 years ago

Hello,

Thank you for making HashOver available as open source. I installed HashOver on a subdomain - comments.my-domain.de including MySQL access. HashOver is accessed via - my-domain.de. This works well in live operation, but not in local development. Is there a way to access the externally installed HashOver during local development?

Access from my-domain.de to HashOver looks like this: <div id="hashover"></div> <script type="text/javascript" src="https://comments.my-domain.de/hashover/comments.php">`

The settings.json has the following content, among others: { "allowed-domains": ["my-domain.de","localhost:1313"], "supports-multisites": true, "local-metadata": true, ... }

Best regards Frank

jacobwb commented 3 years ago

How is it not working? Is it showing different comments or showing an error? You should be able to use an externally hosted HashOver in local development, yes.

myFrank-wk commented 3 years ago

I use the static page generator Hugo in version 0.82. In the local environment, the HTML div tag with the ID hashover is simply not filled. No error message. In the Chrome browser the HTML code looks like this:

<script type="text/javascript" src="https://comments.my-domain.de/hashover/loader.php"></script> <script async="" src="https://comments.my-domain.de/hashover/comments.php?cfg[language]=de_DE&amp;cfg[theme]=default-borderless"></script> <div id="hashover"></div>

myFrank-wk commented 3 years ago

Sorry, didn't look properly. The following error output in the chrome browser:

[Deprecation] 'window.webkitStorageInfo' is deprecated. Please use 'navigator.webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead.

Access to XMLHttpRequest at 'https://comments.my-domain.de/hashover/backend/comments-ajax.php' from origin 'http://localhost:1313' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://localhost:1313' that is not equal to the supplied origin.

Uncaught TypeError: Cannot read property '1' of null at HashOverConstructor.jsonp (comments.php?cfg[language]=de_DE&cfg[theme]=default-borderless:8) at onError (comments.php?cfg[language]=de_DE&cfg[theme]=default-borderless:8) at XMLHttpRequest.xhr.onreadystatechange (comments.php?cfg[language]=de_DE&cfg[theme]=default-borderless:8)

comments.php?cfg[language]=de_DE&cfg[theme]=default-borderless:8 POST https://comments.my-domain.de/hashover/backend/comments-ajax.php net::ERR_FAILED