Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 654c37e6 authored by Guillaume Jacquart's avatar Guillaume Jacquart
Browse files

feat:5629: remove hostnames that could annoy user like adobe.com, snapchat.com.

parent 74b88c64
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@ function enrichTrackersWithHostnames(trackerList, hostnameSet) {
  })
}

// Not used, removes 1800/18000 hostnames.
function keepOnlyHostnamesInHostnamesSet(trackerList, hostnameSet) {
  console.log("hostnameSet.size : " + hostnameSet.size)
  const deleted = new Set()
@@ -94,13 +93,11 @@ function keepOnlyHostnamesInHostnamesSet(trackerList, hostnameSet) {
    tracker.hostnames
      .filter(it => it.split(".").length == 2 && !hostnameSet.has(it))
      .forEach(it => {
        
        remove(tracker.hostnames, it)
        deleted.add(it)
      })
  })
  console.log("Delted hostnames: " + deleted.size)
  console.log(Array.from(deleted))
  console.log("Deleted hostnames not in hostnames list : " + deleted.size)
}

function removeWhitelistedHostnames(trackersList) {
@@ -144,8 +141,10 @@ Promise.all([
    const hostnameSetToConsume = new Set(hostnameSet)
    applyOutbrainRule(eTrackers, hostnameSetToConsume)
    enrichTrackersWithHostnames(eTrackers, hostnameSetToConsume)
// Remove 10% of the hostnames, but should avoid unaccessible sites.
//    keepOnlyHostnamesInHostnamesSet(eTrackers, hostnameSet)
    
    // Remove 10% of the hostnames, 
    // but should avoid unaccessible sites like adob.com or snapchat.com
    keepOnlyHostnamesInHostnamesSet(eTrackers, hostnameSet)
    removeWhitelistedHostnames(eTrackers)
    return eTrackers
}).then(eTrackers => {
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.