Chrome 기록을 AWS로부터 보호 (chrome-extension)
9534 단어 Chrome자바스크립트chrome-extension
배경
오늘 조사한 그게 어디였는지~
역사에 남아있는 하즈군요,,,,
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
aws 콘솔 뿐!
이력을 전혀 남기지 않을 수도 있고, 필요없는 이력은 지우고 싶고,
맞아! 교토에 가자 chrome-extension을 만들자
사양
브레스트
특히 없음. 설정 화면이 귀찮아 보인다 ← 실제로 그랬다
파일 구성
마지막 반성을 활용하고 분화하지 않음
root_folder
│ manifest.json
│ options.html
│
├─img
│ icon-128x128.png
│ icon-16x16.png
│ icon-48x48.png
│
├─js
│ background.js
│ jquery-3.4.1.min.js
│ script.js
│
└─css
chromeapp.js
출처
기록을 삭제할 수 있는 권한이 history
설정을 로컬 스토리지에 저장할 수 있는 권한이 storage
다국어 대응은 귀찮아
manifest.json
{
"name": "off-the-record History",
"version": "1.0.0",
"manifest_version": 2,
"description": "off-the-record history",
"permissions": [
"history",
"storage"
],
"background": {
"scripts": ["js/background.js"]
},
"icons": {
"128": "img/icon-128x128.png",
"48": "img/icon-48x48.png",
"16": "img/icon-16x16.png"
},
"options_ui": {
"page": "options.html",
"chrome_style": false
}
}
설정 화면의 js이므로 생략
jquery-3.4.1.min.js도 설정 화면 용
설정과 match 하면, chrome.history.deleteUrl 하면 됩니다.
이벤트는 console.log에서 확인하고 onVisited에만 적용했습니다.
match하자마자 처리를 끝내고 싶기 때문에
for (var i=0;・・・
를 사용했다. forEach는 break 할 수 없다고 한다.background.js
chrome.history.onVisited.addListener(function(history_item) {
chrome.storage.sync.get([chrome.runtime.id], function(val){
var jsonstr = val[chrome.runtime.id];
if (!jsonstr) {
return;
}
var patterns = JSON.parse(jsonstr);
if (0 == patterns.length) {
return;
}
for (var i=0; i<patterns.length; i++) {
var pattern = patterns[i];
if (!pattern.checked) {
continue;
}
if (history_item.url.match(pattern.regexp)) {
chrome.history.deleteUrl({url: history_item.url});
break;
}
}
});
});
주의점
마지막주의 사항과 동일
공개
off-the-record History
스스로 말하는 것도 있습니다만, 편리합니다.
현재 다음 4가지를 지정하고 있습니다.
기록 제외 설정
https://*.slack.com/
https://*.aws.amazon.com/
https://*.heroku.com/
https://photos.google.com/
도전
off-the-record History
스스로 말하는 것도 있습니다만, 편리합니다.
현재 다음 4가지를 지정하고 있습니다.
기록 제외 설정
https://*.slack.com/
https://*.aws.amazon.com/
https://*.heroku.com/
https://photos.google.com/
도전
귀찮아서 만년 과제. 사용자 수가 1000을 넘으면 생각한다는 것으로
우려사항
Reference
이 문제에 관하여(Chrome 기록을 AWS로부터 보호 (chrome-extension)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/ctrlzr/items/062d79faa367a590d729텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)