破解iframe微信推文(图片)防盗链

$.ajaxPrefilter(function(options) {
  if(options.crossDomain && jQuery.support.cors) {
  var http = (window.location.protocol === 'http:' ? 'http:' : 'https:');
  options.url = http + '//cors-anywhere.herokuapp.com/' + options.url;
  }
});

var share_link = "http://mp.weixin.qq.com/s/NVF_8CJNTwhvg-Zfa6yV3Q"; //微信文章地址
$.get(
  share_link,
  function(response) {
  //console.log("> ", response);
  var html = response;
  html = html.replace(/data-src/g, "src");
  var html_src = 'data:text/html;charset=utf-8,' + html;
  $("iframe").attr("src", html_src);
});

 

  

转载于:https://www.cnblogs.com/xiaomingSun/p/6761708.html

你可能感兴趣的:(破解iframe微信推文(图片)防盗链)