Javascript window.location.reload在Chrome中工作正常,但在firefox中不工作

Javascript window.location.reload在Chrome中工作正常,但在firefox中不工作,javascript,reactjs,firefox,reload,mozilla,Javascript,Reactjs,Firefox,Reload,Mozilla,在以PDF格式打印网页后,我正在重新加载网页。因此,打印后,我提供了window.location.reload方法。它在Chrome上运行良好,但在Firefox上不起作用。我如何解决这个问题 printDocument = () => { const { match } = this.props; const { orderNo } = match.params; this.setState({ showPickSheet: true }, () => { c

在以PDF格式打印网页后,我正在重新加载网页。因此,打印后,我提供了window.location.reload方法。它在Chrome上运行良好,但在Firefox上不起作用。我如何解决这个问题

printDocument = () => {
  const { match } = this.props;
  const { orderNo } = match.params;
  this.setState({ showPickSheet: true }, () => {
    const printContents = document.getElementById("divToPrint").innerHTML;
    document.title = `PickSheet_${orderNo}`;
    const originalContents = document.body.innerHTMl;
    document.body.innerHTML = printContents;
    window.print();
    document.body.innerHTML = originalContents;
    window.location.reload();
  });
};

这在chrome和firefox中都适用

location.reload();
好了 位置。重新加载(强制加载); 将
true
添加到重新加载功能中。它应该适用于任何地方

// Reload the current page without the browser cache
location.reload(true);

您可以使用它,它在firefox和chrome中都可以使用,但它说不必要使用Location检查此线程:
setTimeout(function(){
  window.location.reload();
});