Skip to content

Commit 3c37e50

Browse files
committed
Fixed problems with hash in urls (Issue 114).
1 parent 14728e9 commit 3c37e50

5 files changed

Lines changed: 11 additions & 0 deletions

File tree

cefpython/cef3/linux/binaries_32bit/wxpython.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,5 +545,7 @@ <h3>Other tests</h3>
545545
<li><a href="javascript:external.GoForward()">external.GoForward()</a>
546546
</ul>
547547

548+
<a name="test-hash"></a>
549+
548550
</body>
549551
</html>

cefpython/cef3/linux/binaries_32bit/wxpython.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ def __init__(self, url=None):
9898
title='wxPython CEF 3 example', size=(800,600))
9999
if not url:
100100
url = "file://"+GetApplicationPath("wxpython.html")
101+
# Test hash in url.
102+
# url += "#test-hash"
101103

102104
self.CreateMenu()
103105

cefpython/cef3/linux/binaries_64bit/wxpython.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,5 +545,7 @@ <h3>Other tests</h3>
545545
<li><a href="javascript:external.GoForward()">external.GoForward()</a>
546546
</ul>
547547

548+
<a name="test-hash"></a>
549+
548550
</body>
549551
</html>

cefpython/cef3/linux/binaries_64bit/wxpython.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ def __init__(self, url=None):
9898
title='wxPython CEF 3 example', size=(800,600))
9999
if not url:
100100
url = "file://"+GetApplicationPath("wxpython.html")
101+
# Test hash in url.
102+
# url += "#test-hash"
101103

102104
self.CreateMenu()
103105

cefpython/utils.pyx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ cpdef str GetNavigateUrl(py_string url):
5555
# >> %E6%A1%8C%E9%9D%A2
5656
url = urllib_pathname2url(url)
5757
url = re.sub("^file%3A", "file:", url)
58+
# Allow hash when loading urls. The pathname2url function
59+
# replaced hashes with "%23" (Issue 114).
60+
url = url.replace("%23", "#")
5861
return str(url)
5962

6063
IF CEF_VERSION == 1:

0 commit comments

Comments
 (0)