-1
저는 Vk 코멘트 자동화를 위해 greacemonkey userscript를 코딩하고 있습니다.Greasemonkey unsafeWindow Vk
그리고 개체에 액세스 할 수없는 이유를 이해할 수 없습니다.
Vk을 창 (첫번째 자본 낮은 같은 단어지만) 두 개의 서로 다른 작곡가 및 작곡가 개체가 OBJ. unsafeWindow 작곡가는 액세스 가능하지만 소문자 오브젝트 작성자는 정의되지 않은 상태로 돌아갑니다. 직접 브라우저 콘솔에서
composer.addMedia.checkMessageURLs("Comment text<br />http://example.com",true);
을 실행하면
(function (window, undefined) {
.....
some code
finding post, openning comment form, pasting text
need to call:
unsafeWindow.composer.addMedia.checkMessageURLs("Comment text<br />http://example.com",true);
.....
console.log(unsafeWindow.Composer); // return object
console.log(unsafeWindow.composer); // return undefined
}
- 모든 확인.
아이디어가 있으십니까?
고맙습니다! 그것은 작동합니다! – Dmitry
당신을 진심으로 환영합니다. 기꺼이 도와주세요! –