如何从iPhone发送页面源到PHP帖子

Copied a JavaScript 10 years ago from somewhere what I been using to track certain elements found on a website. The webpage where information is collected are required 2 factors authentication so passing information is complicated. Back in the days decided to just use a JavaScript to send the entirety webpage from the user device to a php page where php looks for certain elements and extract information. The JavaScript saved on the user smartphones and when logged in to the website the user select the bookmark. Very simple concept but stoped working yesterday.

The code based on this found in a article what is still working but the modified wersion not working anymore.

“Working fine to display page source”

javascript: (function() {
  var a = window.open('about:blank').document;
  a.write('Source of ' + location.href + '');
  a.close();
  var b = a.body.appendChild(a.createElement('pre'));
  b.style.overflow = 'auto';
  b.style.whiteSpace = 'pre-wrap';
  b.appendChild(a.createTextNode(document.documentElement.innerHTML))
})();

No longer working, getting error 413.

javascript: (function() {
  var d = window.open('about:blank'),
    a = d.document;
  a.write('<!DOCTYPE html><html><head><title>Loading Source</title></head><body></body></html>');
  a.close();
  var b = a.body.appendChild(a.createElement('form'));
  b.setAttribute('method', 'post');
  b.setAttribute('action', 'https://webpageextract/extraction.php/?uri=' + location.href);
  var c = b.appendChild(a.createElement('input'));
  c.setAttribute('type', 'hidden');
  c.setAttribute('name', 'DOM');
  c.setAttribute('value', encodeURIComponent(document.documentElement.innerHTML));
  b.submit()
})()
dongyi4420
dongyi4420 感谢提醒,我只是从内联书签粘贴,绝对更具可读性。也许有用的信息,网页大小262k
一年多之前 回复
dsla94915
dsla94915 请正确格式化您的代码
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐