일렉트론 렌더러 내 웹뷰 executeJavaScript 사용 시 데이터 수집

조회수 1381회

renderer html

webview id="github" src="https://github.com"></webview

renderer js

const githubWebview = document.getElementById('github');

console.log('start');

let title = "";
githubWebview.executeJavascript(`
  var title = document.title;
  title;
`, function(res){
  console.log(res);
});

console.log('end');

이렇게 실행하면 start -> end -> GitHub 이렇게 순서대로 나오는데

start -> GitHub -> end 순으로 나오게 할 수 있나요? 그리고 콜백에서 let title 에 값을

할당할 수 있는지.. 어떻게 해보려고해도 방법을 모르겠네요 ㅜ

도움 부탁드립니다.

  • (•́ ✖ •̀)
    알 수 없는 사용자

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)