-
Notifications
You must be signed in to change notification settings - Fork 2
/
popup.js
33 lines (30 loc) · 1007 Bytes
/
popup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
document.addEventListener('DOMContentLoaded', function () {
document.querySelector('button').addEventListener('click', onclick,false)
function onclick(){
//do when button clicked
chrome.tabs.query({currentWindow: true, active: true}, function (tabs) {
chrome.tabs.sendMessage(tabs[0].id, 'hi')
})
}
function setCount(res){
const div = document.createElement('div')
div.textContent = {}
}
}, false)
//
//var counter = 0
// const threshold = 0.9;
// toxicity.load(threshold).then(model => {
// for (index = 0; index < sp.length; index++) {
// model.classify(sp).then(predictions => {
// //console.log(predictions);
// for(i=0; i<7; i++){
// if(predictions[i].results[0].match){
// counter++;
//
// }
// }
// });
// }
// })
//import * as toxicity from '@tensorflow-models/toxicity';