Git Product home page Git Product logo

Comments (4)

LancelotLewis avatar LancelotLewis commented on August 22, 2024

@guduchina chrome下确实不行,我是用360极速浏览器没问题。chrome这边可能是事件兼容性的问题,我有时间再具体研究,到时候会通知你,感谢反馈

from local-kitymind.

Pengwei-Chen-1 avatar Pengwei-Chen-1 commented on August 22, 2024

我实在是找不到其他的方法了。。。。。
高版本的chrome下确实不行,不过52版本的chrome貌似可以。
我改了下导出的方法,创建了一个a链接,点击可下载文件,多了一步。

`// 由于chrome较高版本中无法实现自动触发event,所以改用以下方法进行导出
var fileName = $('#node_text1').text()+'.'+type;
var aLink = document.createElement('a');
// 点击后自动删除当前a标签
aLink.onclick = function() {
$(this).remove();
};

var node = document.createTextNode(fileName);
aLink.appendChild(node);
var blob = new Blob([content]);
aLink.download = fileName;
aLink.href = URL.createObjectURL(blob);
$('.editor-title').append(aLink);`

from local-kitymind.

LancelotLewis avatar LancelotLewis commented on August 22, 2024

@guduchina chrome的机制是阻止代码触发的页面点击事件,据说是为了防止广告,之前听说一个办法是设置setTimeout延时执行代码模拟的点击事件。

from local-kitymind.

LancelotLewis avatar LancelotLewis commented on August 22, 2024

@guduchina 使用了很奇葩的方式hack了chrome浏览器的限制,仅供参考

from local-kitymind.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.