history.pushState 不会为移动设备上的 "share ..." 按钮更新 url Chrome

history.pushState does not update url for "share ..." button on mobile Chrome

我正在使用 history.pushState 更新 URL 如下:

var state = {url: newLocation};
window.history.pushState(state, pagetitle, newLocation);    

在移动设备 Chrome 上,网页 URL(在 URL 栏上)和标题会按预期更新。但是当单击 Chrome 菜单上的 "Share..." 按钮时,将共享旧的 URL(调用 history.pushState 之前)。我错过了什么吗?我该如何解决?谢谢!

我发现 rel="canonical" url 也应该更新。

$('link[rel="canonical"]').attr('href', newLocation);