Greasy Fork

调整打印文件

2022/8/3 08:33:33

当前为 2022-08-03 提交的版本,查看 最新版本

// ==UserScript==
// @name        调整打印文件
// @namespace   print adjust
// @match       https://ctbpsp.com/#/bulletinDetail?uuid=*
// @run-at      document-end
// @grant       unsafeWindow
// @version     1.1
// @author      我爱小熊啊
// @description 2022/8/3 08:33:33
// @description 中国招标投标公共服务平台公告文件打印调整
// @license     MIT
// ==/UserScript==

setTimeout(function(){
  // var windowAttribute = $('iframe');  ??? 引入 jQuery 库也不生效
  var windowAttribute = document.getElementsByTagName('iframe')[0];
  var n = prompt('请输入文件页码','');
  if(n){    // 如果输入框点击取消,则 prompt 返回的是 null,则取消更改,否则网页会出错
    windowAttribute.width = 900;
    windowAttribute.height = 1150 * n;
  // alert("Hello");
  }
}, 3000);