js自定义绑定dom id

2019-10-19 00:00:00 by 【6yang】, 29 visits, 收藏 | 返回
 
const $ = document.querySelector.bind(document);

const webview = $('#webview');
  const captureWebview = $('#captureWebview');
  // preload
  const preloadFile = 'file://' + require('path').resolve('./preload.js');
  webview.setAttribute('preload', preloadFile);
   
  // Forwards, backwords, refresh, and loadURL
  const forwards = $('#forwards');
  forwards.addEventListener('click', () => {
  if (webview.canGoForward()) {
  webview.goForward();
  }
  });
 
分享到:
share

    图片原图

    loading

    loading