From cbe168d6b9c4d7e150aea844c1f849628b33c421 Mon Sep 17 00:00:00 2001 From: Dmitry S Date: Thu, 3 Aug 2017 17:59:21 -0400 Subject: [PATCH 1/2] Fix viewing of pages using file:/// urls. This requires, in particular, coping with iframe being considered a different origin, so that all communication is done using postMessage. --- mkdocs_windmill/js/base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs_windmill/js/base.js b/mkdocs_windmill/js/base.js index dfe70a0..6e7ee4c 100644 --- a/mkdocs_windmill/js/base.js +++ b/mkdocs_windmill/js/base.js @@ -69,7 +69,7 @@ function updateIframe(enableForwardNav) { // Grey out the "forward" button if we don't expect 'forward' to work. $('#hist-fwd').toggleClass('greybtn', !enableForwardNav); - var targetRelPath = getRelPath('#', mainWindow.location.href) || ''; + var targetRelPath = getRelPath('#', mainWindow.location.href) || 'index.html'; var targetIframeUrl = getAbsUrl('/', targetRelPath); var loc = iframeWindow.location; var currentIframeUrl = _safeGetLocationHref(loc); From 10b1bd135e47254329665e0f7eef2fdd4fcd73cd Mon Sep 17 00:00:00 2001 From: Dmitry S Date: Tue, 8 Aug 2017 15:11:59 -0400 Subject: [PATCH 2/2] Actual fix for viewing pages using file:// urls --- mkdocs_windmill/base.html | 3 +- mkdocs_windmill/css/base.css | 4 ++ mkdocs_windmill/js/base.js | 121 ++++++++++++++++++++--------------- 3 files changed, 75 insertions(+), 53 deletions(-) diff --git a/mkdocs_windmill/base.html b/mkdocs_windmill/base.html index 27f56f9..7e94c48 100644 --- a/mkdocs_windmill/base.html +++ b/mkdocs_windmill/base.html @@ -49,6 +49,7 @@ {%- block scripts %}