Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

googleCS.js : Removes the "Index of " portion from the search result #77

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# chrome-search-extension
# Fearch

A chrome extension that lets you search music, videos, ebooks and other content available on FTP servers. It uses simple google search under the hood with the query modified to look only for FTP servers. We are interested in the content that is freely available on these servers.

Expand Down
15 changes: 15 additions & 0 deletions googleCS.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
var st;
var x;
var i;
var pos;

var s = document.createElement("script");
s.src = chrome.extension.getURL("googleFearch.js");
(document.head || document.documentElement).appendChild(s);

// removing the leading Indeex of part from search results
x = document.document.getElementsByClassName("r");
for (i = 0; i < x.length; i += 1) {
st = x[i].innerHTML;
pos = st.search("Index of /" || "Index of");
if (pos !== -1) {
x[i].innerHTML = st.replace(st.substring(pos, pos + 10), "");
}
}

// After loading and execution, the node disappears so no one can trace code.
s.onload = function () {
s.parentNode.removeChild(s);
Expand Down