안녕하세요, 이메일 첨부 파일 (일반 txt)을 읽어야하는 크롬 확장 프로그램을 작성하려고합니다. Gmail이 당신에게 다운로드 링크를 제공하기 때문에 이것이 가능해야한다고 생각합니다. 그러나 직접 링크가 아니기 때문에 불가능합니다.Chrome 확장 프로그램에서 Gmail 첨부 파일에 액세스 하시겠습니까?
I Gmail에 그냥 작동하는 원격 파일을 읽을 수있는 다음과 같은 코드가 있습니다
이<script>
var txtFile = new XMLHttpRequest();
txtFile.open("GET", "http://remote.com/remote_file", true);
txtFile.onreadystatechange = function() {
if (txtFile.readyState === 4) { // Makes sure the document is ready to parse.
if (txtFile.status === 200) { // Makes sure it's found the file.
allText = txtFile.responseText;
lines = txtFile.responseText.split("\n"); // Will separate each line into an array
alert(allText)
}
}
}
txtFile.send(null);
</script>
아무도 내가 이런 Gmail은 첨부 파일을 읽을 수있는 방법을 알고 있나요을? 감사합니다.
콘솔의 오류 메시지? – Skomski
불행히도 아무 것도 없지만 if 문을 주석 처리하면 경고는 빈 경고를 반환합니다. –
@RichardMosse이 솔루션을 찾았습니까 ??? 내 확장에 필요합니다. –