Skip to content

Commit

Permalink
Merge pull request #13 from Procyon-b/fixAutoDetect
Browse files Browse the repository at this point in the history
Un-break uk.webuy.com.
  • Loading branch information
cxw42 authored Jun 16, 2018
2 parents 8202afc + eb8425c commit 625afe8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Additional contributors (in alphabetical order):
- [jhard](https://github.com/jhard)
- [karlicoss](https://github.com/karlicoss)
- [panozzaj](https://github.com/panozzaj)
- [Procyon-b](https://github.com/Procyon-b)
- [rspeed](https://github.com/rspeed)


16 changes: 9 additions & 7 deletions src/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function spoilFormGet(elem) {
}
} //spoilFormGet

function main() {
function main() { // runs on DOMContentLoaded

// OpenSearch - e.g., https://martin-thoma.com/search-engine-autodiscovery/
// Uses CSS4 selectors, Chrome 49+
Expand All @@ -59,13 +59,15 @@ function main() {
}
);

// Chrome autodetection, https://www.chromium.org/tab-to-search #2
document.querySelectorAll('form:-webkit-any([method="get" i],:not([method]))').forEach(spoilFormGet);
// Chrome autodetection, https://www.chromium.org/tab-to-search #2 .
window.addEventListener('load', function() {
document.querySelectorAll('form:-webkit-any([method="get" i],:not([method]))').forEach(spoilFormGet);

if(DEBUG) {
console.log(`Spoiled ${numspoiled}/${numseen}. Unspoiled were:`);
console.log(unspoiled);
}
if(DEBUG) {
console.log(`Spoiled ${numspoiled}/${numseen}. Unspoiled were:`);
console.log(unspoiled);
}
});
} //main

document.addEventListener('DOMContentLoaded', main);
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Greg Sadetsky et al.",
"manifest_version": 2,
"name": "Don't add custom search engines",
"version": "0.0.3",
"version": "0.0.4",
"description": "Prevent Google Chrome from auto-adding custom search engines",
"minimum_chrome_version": "49.0.0.0",
"offline_enabled": true,
Expand Down

0 comments on commit 625afe8

Please sign in to comment.