Skip to content
This repository was archived by the owner on Nov 24, 2020. It is now read-only.
This repository was archived by the owner on Nov 24, 2020. It is now read-only.

JS prevents navigation of local files #28

Description

@gubler

navigation.js prevents the browser from navigating normally if the AJAX request fails.

If a page is loaded from the file system (not through a server), the AJAX request generated on navigation fails due to CORS restrictions.

I think the problem is that line 297 is commented out:

return loading.show(
        promise
        .fail(function (e) {
            console.log(e); // eslint-disable-line no-console
            // location.href = relativeUrl;  <--- THIS LINE HERE
        })
    );

After the AJAX load fails and the error is logged to the console, the location is never updated and so the browser is never forwarded to the new page.

Activity

  1. yeluolei commented on May 9, 2017

    @yeluolei

    same issue here, any idea for how to fix this problem?

  2. mikesamuel commented on Nov 14, 2017

    @mikesamuel

    I had this problem as well. I managed to test the output of

    gitbook build . gitbook_out

    locally around by running

    pushd gitbook_out && \
    python -m SimpleHTTPServer 8000; \
    popd

    and browsing to http://127.0.0.1:8000/index.html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions