Skip to content
This repository was archived by the owner on Sep 7, 2020. It is now read-only.
Open
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
26 changes: 8 additions & 18 deletions src/content_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,19 @@ function walk(node)
break;

case 3: // Text node
handleText(node);
node.nodeValue = handleText(node.nodeValue);
break;
}
}

function handleText(textNode)
function handleText(text)
{
var v = textNode.nodeValue;

v = v.replace(/\bAWS Lambda\b/g, "AWS Common Gateway Interface");
v = v.replace(/\bAWS lambda\b/g, "AWS Common Gateway Interface");
v = v.replace(/\baws Lambda\b/g, "AWS Common Gateway Interface");
v = v.replace(/\baws lambda\b/g, "AWS Common Gateway Interface");

v = v.replace(/\bServerless\b/g, "cgi-bin");
v = v.replace(/\bserverless\b/g, "cgi-bin");

v = v.replace(/\bcgi-bin architecture\b/g, "Common Gateway Interface architecture");
v = v.replace(/\bcgi-bin architectures\b/g, "Common Gateway Interface architecture");
v = v.replace(/\bcgi-bin Architecture\b/g, "Common Gateway Interface architecture");
v = v.replace(/\bcgi-bin Architectures\b/g, "Common Gateway Interface architecture");

textNode.nodeValue = v;
return text
.replace(/\baws lambda\b/gi, "AWS Common Gateway Interface")
.replace(/\bserverless\b/gi, "cgi-bin")
.replace(/\bcgi-bin architectures?\b/gi, "Common Gateway Interface architecture")
//.replace(/\bcontainer\b/gi, "chroot")
//.replace(/\belectron\b/gi, "JVM")
}