// ==UserScript==
// @name Fresh Foods
// @namespace Fresh Foods
// @include about:addons
// @version 1
// @grant none
// ==/UserScript==
(function() {
var patterns = [], classes = [];
/* The following define the classes of words. If the first
character of the specification is "=", the match will be
case-sensitive, otherwise it will be case-insensitive.
The specification is a regular expression, and should
contain metacharacters to handle variant spellings and
plurals. Any grouping within these patterns *must* be done
with a (?: ... ) specification to avoid messing up the
capture from the text string.
You may add additional categories as you wish, but be sure to
declare their rendering in the style definition below. */
// Rendering styles for our various word classes
addGlobalStyle('span.blue { background-color: #D0D0FF; } ' +
'span.silver { background-color: #A4A4A4; } ' +
'span.gold { background-color: #FE9A2E; } ');
// MSM "blue" words
defwords([
"Swirly Chocolate Milk",
"Rice Dice",
"Pasta Nest",
"Felberry Gormball Sandwich",
"Pastrami Gormball Sandwich",
"Toast on Toast",
"Freeze Dried Sausage",
"Stone Veggie Gormball Sandwich",
"Mynci Fruit Kebab",
"Morel Mushroom Dip",
"Super Icy Negg",
"Taco Salad",
"Strawberry Parfait",
"Chips and Egg",
"Chestnut Soup",
"Gnome Crunch",
"Phear Flavoured Milk",
"Deep-Fried Mac-n-Cheese Loaf",
"Egg Pate",
"Hash Browns",
"Cinnamon Toasties",
"Snotty Vira Onion",
"Lemonade",
"Lunch Cereal",
"Kau Ice Lolly",
"Chocolate Green Tea Parfait",
"Cupid Negg",
"Chokato Omurice",
"Lutical Berries",
"Kyrii Jumbleberry Milkshake",
"Carrots in Salad",
"Kyrii Dewy Apple Milkshake",
"Tofu Poogle Pate",
"Paper-Wrapped Chicken",
"Chicken Taquitos",
"Hot Dog on a Stick",
"Lemon Swirly Negg",
"Quiggle Veggie Soup",
"Cucumber Tea Sandwiches",
"Chia Cereal",
"Ogrin Peanut Butter and Jelly Sandwich",
"Cole Slaw",
"Plain Onigiri",
"Raspberry Basket",
"Korbat Cheese and Crackers",
"Garlic Mashed Potatoes",
"Snow Enchiladas",
"Jhudora Eyeball Pasta",
"Raspberry Yurblecone",
"A Smatter of Mayo",
"Sparkling Blue New Year Juice",
"Fruit Basket",
"Suspicious Borovan Creame Pie",
"Purple Bruce Juice",
"Mini Swiss Kau Cheese Wheel",
"Sausage Gravy",
"Sour Cream Chomby Crisps",
"A Smatter of Ketchup",
"Korbat Pasta and Meatballs",
"Mint Chip Skeith Cone",
"Sloth Day Nachos",
"Kyrii Florange Milkshake",
"Cheese and Tonu Crackers",
"Extra Large Xweetok Sushi",
"Crunchy Buzz Honey Delight",
"Ham Casserole",
"Paper-Wrapped Veggies",
"Potato Salad",
"Red Buzz Energy Drink",
"Giblets Gravy",
"Bubbly Twirly Fruit Juice",
"Turkey Curry",
"Orange Yurblecone",
"Raspberry Aisha Waffle",
"Strawberry Skeith Cone",
"Moehog Milkshake",
"Apple Walnut Tea Sandwiches",
"Scaled Negg",
"Caviar Sandwich",
"Dirt Achyfi",
"Teasicle",
"Draik Soup",
"Gnorbu Wool Burger",
"Ogrin Pasta",
"Veal Parmesan Gormball Sandwich",
"Wishbone Delight",
"Blue Bruce Juice",
"Veggie Delight Jetsam Fin Crackers",
"Moehog Grilled Peanut Butter Sandwich",
"Double Scoop of Sorbet",
"Invisible Negg",
"Extra Meaty Pie",
"Dirt Ice Cream",
"Mini Kau Cheese Wheel",
"Fried Potato Balls",
"Strawberry Ixi Fizzy Drink",
"Beef and Veggie Soup",
"Pineapple and Broccoli Pie",
"A Smatter of Mustard",
"Apple Achyfi",
"Xweetok Sugar Cookies",
"Twirly Fruit Cream Cheese Dip",
"Vanilla Skeith Cone",
"Grilled Islandberry Slices",
"Thornberry Gormball Sandwich",
"CPMPB Pizza",
"Curried Chicken Tea Sandwiches",
"Liver Poogle Pate",
"Sausage and Chips",
"Kadoatie Puffs",
"Blackberry Sorbet",
"Xweetok Veggie Crepe",
"Tea Waffles",
"Creamed Corn",
"Speckled Ice Cream",
"Korbat Veggie Plate",
"Meat Tuskabob",
"Number Jelly Parfait",
"Draik Salad",
"Poogle Spaghetti",
"Vanilla Yurblecone",
"Hearty Pie",
"Blueberry and Orange Blend",
"Sliced Turkey Dinner",
"Continuous Meat",
"Chocolate Elephante Doughnut",
"Yurble Steak",
"Chocolate Nimmo Dessert",
"Lettuce Wrap",
"Salmon Cream Cheese Dip",
"Turkey Leg Pasta",
"Green Negg",
"Zafara Breakfast",
"Beans on Toast",
"Mynci Ham and Cheese Sandwich",
"Koi Seaweed Sundae",
"Fizzy Grape Lupe Drink",
"Flotato-Stuffed Turkey",
"Fresh Borovan and Asparagus Tart",
"Left-Over Sliced Turkey Sandwich",
"Chocolate Covered Carrot",
"Poogle Pot Pie",
"Chokato Sundae",
"Chocolate Chomby Ice Cream Sandwich",
"Vanilla Poogle Cupcake",
"Scorched Kabob",
"Spicy Purblare Juice",
"Small Fizzy Drink",
"Vanilla Aisha Pudding",
"Sweet and Sour Soup",
"Number Crackers and Cheese",
"Spaghetti Hot Dog",
"Peanut Butter and Jelly Gormball Sandwich",
"Flaming Hot Burger",
"Paper-Wrapped Salmon",
"Dried Lupe Snack",
"Pickled Apples",
"Mini Koi Cereal",
"Turkey Pie",
"Watercress Tea Sandwiches",
"Spicy BBQ Chomby Crisps",
"Lamb Chop",
"Nimmo Meatloaf",
"Techo Garden Salad",
"Turkey Leg",
"Disco Toast",
"Purple Crisps",
"Raspberry Baby JubJub Lollypop",
"Chocolate Poogle Lolly",
"Orange Jetsam Cupcake",
"Chicken Dumpling Soup",
"Dirt Burgers",
"Lime Swirly Negg",
"Xweetok Burger",
"Vegetarian Usul Wrap",
"Chocolate Gnome Crunch",
"Chestnut Shortcake",
"Lupe Burger",
"Black Cherry Taco",
"Buzz Honey Pot",
"Sour Apple Ixi Fizzy Drink",
"Steak Platter",
"JubJub Strawberry Juice",
"Mynci Mushroom Soup",
"Chocolate Poogle Cupcake",
"White Cheddar Jetsam Fin Crackers",
"Celery Achyfi",
"Mild Cheddar Jetsam Fin Crackers",
"Rainbow Artichoke",
"Sloth Day Soup",
"Quiggle Stew",
"Custard",
"Aisha Tomato and Potato Soup",
"Wocky Pot Pie",
"French Toast",
"Number Fruit Leather",
"Carrot Cupcake",
"Furanga Fruit Sandwich",
"Sketch Sundae",
"Gnorbu Wool Candy Floss",
"Seasoned Lupe Chips",
"Gnorbu Wool and Jelly Sandwich",
"Steel Negg",
"Chunky Mushroom Soup",
"Chocolate Chip Gelert Ice Cream Sandwich",
"Cherry Mynci Burger",
"Deep-Fried Candy Floss",
"BLT Sandwich with Cheese",
"Orange Filled Jacket Potato",
"Lemon and Orange Blend",
"Blumaroo Ice Cream Sundae",
"Cheese Sticks",
"Mutant Cheese Pizza Slice",
"Blueberry Jelly Doughnut",
"Water Cake",
"Fire Tonic",
"Plain Bagel",
"Potato Chips on a Paper Plate",
"Disco Ice Cream",
"Chokato Cream Cheese Dip",
"Flotsam Ice Cream Sundae",
"Hot Buzz Pie",
"Peanut Dash Shake",
"Gnorbu Chocolate Pudding",
"Tuskaninny Ice Cream",
"Dressing and Cranberry Sandwich",
"Orange Baby Aisha Lollypop",
"Dried Chilli Peppers",
"Tea Jelly",
"Aisha Mega Burger",
"Iced Shoyru Meatball",
"Golden Tangerines",
"Mutant Doughnut",
"Pickled Pears",
"Bacon Achyfi",
"Tofukabob",
"Blue Berry Aisha Ice Cream",
"Buzz Sandwich With Honey",
"Acara Rainbow Lollypop",
"Wormy Jam Sandwich",
"Carrot On A Stick",
"CPMPB Salad",
"Chicken With Vegetables",
"Deep-Fried Vegetables",
"Rainbow Burger with Cheese",
"Purple Negg",
"Symol Cheddar Cheese Ball",
"Smiley Pancakes",
"Uni Corn",
"Fruity Aisha Sundae",
"Blue Acara Cake",
"Cheesykraut Hot Dog",
"Deluxe Cheese Fondue",
"Tigerbuggle JubJub Mini Burger",
"Grapefruit Biscuits",
"Moehog Marmalade",
"Elephante Ice Cream",
"Cheesy Onion Noodle Soup",
"Ixi Double Veggie Burger",
"Deluxe Ham Sub",
"Roasted Chestnuts",
"Mynci Steak",
"Mini Ice Cream",
"Strawberry Cybunny Ice Cream",
"Kacheek Meatball",
"Mayonnaise Chilli and Cheese covered Corn on the Cob",
"Chicken Tuskabob",
"Dung Negg",
"Speckled Veggie Burger",
"Wocky Spaghetti Ball",
"Tonu Cheeseburger",
"Cream of Tchea Soup",
"Bowl Hominy",
"Tangy Cheesicle",
"Chocolate Aisha Sundae",
"Doglefox Cookies",
"Wheaty Sloth Day Burger",
"Egg Roll",
"Tarragon Achyfi",
"Vanilla Flotsam Day Shake",
"Eggy Weggs",
"Purple Hamburger",
"Strawberry Scorchio Treat",
"Peanut Butter and Jelly Hot Dog",
"Strawberry Gelert Shake",
"Yurble Pot Pie",
"Pomegranate",
"Lemint Green Salad",
"Ixi Acorn Meatball",
"Sketch Pie",
"Uh Oh, Spaghetti Eyes",
"Pickled Peppers",
"Extra Large Fizzy Drink",
"Triple Scoop of Sorbet",
"Black Cherry Pudding",
"Fresh Durian",
"Plain Cheesicle",
"Cheese Negg",
"Deceptive Salad",
"Turkey Enchilada",
"Veggie Tuskabob",
"Captain Scarblade Crunch Cereal",
"Turkey Croquettes",
"Cheesy Popcorn",
"Zafara Vegetable Croissant",
"Coral Delight",
"Seaweed Bacon",
"Fruit Punch Roll",
"Strawberry Jetsam Ice Cream",
"Bubbly Harffel Fruit Juice",
"Jicama",
"Mutant Hot Dog",
"Mutant Milkshake",
"Carrot Salad",
"Steamed Round Dumplings",
"Florg Burger",
"Number Pasta",
"Shoyru Cereal",
"Uni Triple Scoop Rainbow Sorbet",
"Wocky Veggies and Dip",
"Carrot Fizz Achyfi",
"Broccoli Achyfi",
"Sketch Eggs",
"Twirly Fruit Flavoured Milk",
"Strawberry Ice Cream Sandwich",
"Xweetok Vegetable Soup",
"Creamy Chicken Dish",
"Extra Crispy Bacon Gum",
"Square Marshmallows",
"Minty Blumaroo Cone",
"Red Scorchipepper",
"Sparkling Twirly Fruit Juice",
"Raspberry Cranberry Juice",
"Moehog Fruit Leather",
"Berry Delight",
"Open Top Onion Sandwich",
"Tchea JubJub Mini Burger",
"Flaming Hot Chips",
"Meaty Chia Soup",
],
"blue");
// MSM "silver" words
defwords([
"Techo Jelly Surprise",
"Starry Scorchipepper",
"Zeenana Toffee Apple",
"Fried Something Something",
"Fancy Rack of Lamb with Fruit",
"Meerca Bolognese",
"Lemon Lime Neocola",
"Ruki Salad",
"Unripe Puntec Wrap",
"Grey Waffles",
"Twin Salad",
"Pizza Sandwich",
"Grapeade",
"Slorg Biscuits",
"Flotsam Fin Soup",
"Pumpkin Bread",
"Chocolate Drizzled Popcorn",
"Battle Duck Negg",
"Congratulations Negg",
"Happy Birthday Negg",
"Exotic Plant",
"Chocolate Covered Toffee",
"Butter Toffee Popcorn",
"Raspberry Sundae",
"Orange Bruce Juice",
"Roast Chestnut Neggnog",
"Speckled Negg",
"Cheddar Kacheek Cheese",
"Cheese Rigamaroll",
"Squid Sauce",
"Purple Cybunny Negg",
"Quadruple Scoop of Sorbet",
"Blue Negg",
"King Altador Sack Lunch",
"Strawberry JubJub Sundae",
"Pink Negg",
"Green Scorchipepper",
"Orange Negg",
"Festive Faerie Fizz",
"Yellow Negg",
"Decorative Negg",
"Snow Lemon",
"White Chocolate Covered Toffee",
"Rock Negg",
"Ultra Icy Negg",
"Clam and Meatball Pizza",
"Maple Syrup Negg",
"Partitioned Negg",
"Pickled Onion",
"Freeze Dried Meat",
"Sweet and Sour Negg",
"Candy Cane Negg",
"Ultimate Icy Negg",
"Cheesy Kois",
"Veggie Burger",
"Plain Crackers",
"Holiday Yule Log",
"Chocolate Ice Cream",
"Turkey Dinner",
"Strawberry and Orange Blend",
"Meat and Potatoes Krawk Pot",
"Mosaic Negg",
"Shell Lollypop",
"Slice of Zafara Pizza",
"Buzz Dung Cone",
"Caramel Chia Parfait",
"Buzz Bread Salad",
"Glass Negg",
"Peanut Butter Tonu Crackers",
"Veggie Poogle Pate",
"Swirly Negg #498",
"Valentines Negg",
"Egg Stew",
"Chocolate Kau Milk",
"Star Shaped Cheeseburger",
"Cybunny Carrot Stew",
"Snot Sandwich",
"Ornate Purple Negg",
"Tomato Omurice",
"Seasoned Curly Chips",
"Deep-Fried Okra",
"Spinach Alfredo Omurice",
"Turkey Dumplings",
"Draik Wrap",
],
"silver");
// MSM "gold" words
defwords([
"Jelly Negg",
"Mega Sandwich",
"Chocolate Coated Blue Cheese",
"BLT Croissant",
"Diet Big Gulp Neocola",
"Rainbow Carrot",
"Happy Anniversary Negg",
"Candy Floss Carrot",
"Chocolate Coated Cheese Strings",
"Kadoatie Biscuits",
"Christmas Pattern Negg",
"Puzzle Fruit",
"Cheesy Chocoshake",
"Wocky Plum Pudding",
"Rainbow Cybunny Negg",
"Puntec Cupcake",
"Evil Popcorn",
"Uni Salad",
"Lawyerbot Degreaser",
"Green Picnic Hamper",
"Pretty Purple Princess Negg",
"Extra Fancy Crackers",
"Egg and Tomato Sandwich",
"Blue Cybunny Negg",
"Cheesy Chokato Pie",
"Blue Picnic Hamper",
"Upside Down Ice Cream",
"Grey Eggs and Bacon",
"Fun Icy Cheese Pop",
"Rainbow Apple",
"Mighty Steakwich",
"Plum",
"Pirate Negg",
"Black Currant Juice",
"Rainbow Negg",
"Raspberry Toffee Apple",
"Grey Toast",
"Tigersquash Custard",
"Container of Purple Liquid",
"Chokato Toffee Apple",
"Bag of Peanuts",
"Glowing Apple",
"Cheesy Carrot Chunks",
"Cheesy Strawberry Slice",
"Bacon Taco",
"Lenny Salad",
"Faeriemoya",
"Tchea Toffee Apple",
"Mega Manoroot Sandwich",
"Rainbow Neggnog",
"Steak Surprise",
"Baby Elephante Milk Bottle",
"Purple Picnic Hamper",
"Fire Apple",
"Waffle Burger",
"Steak Negg",
"Stuffed Chokatos",
"Chilli Salmon Souffle",
"Petpet Crackers",
"Peach Jelly",
"Turkey Drumstick Dinner",
"Jalapeno Kacheek Cheese",
"Welsh Rarebit",
"Squibble Berry Sandwich",
"Noil Candy Floss",
"Chokato Neggnog",
"Heart Shaped Negg",
"Watermelon Roll",
"Thistleberry Sandwich",
"Super Icy Custard",
"Deluxe Peophin Burger",
"Lutari Fizz",
"Flaming Tuskaninny Ice Cream",
"Asparagus Borovan Lasagne",
"Puntec Parcel",
"Honey and Bacon Burger",
"Flower Nectar",
"Kau Waffles",
"Snot Fries",
"Funnydew Neggnog",
"Chocolate Shoyru Meatball",
"Borovan Layered Cake",
"Onion and Mustard Pie",
"Mega Tuna Sandwich",
"Black Caviar",
"Mynci Surprise Ice Cream",
"Island Meatloaf",
"Cybunny Day Canape",
"Beef Wellington",
"Chocolate Coated Holey Cheese",
"Cawl",
"Starry Cupcake",
"Buzz Sandwich",
"Mutated Negg",
"Cheesy Krawk Dip",
"Frozen Veggie Delight",
"Meerca Apertif",
"Acara Ice Cream Surprise",
"Tasty Guacamole",
"Chocolate Coated Cheese",
"Mega Pipper Sandwich",
"Bangers and Mash",
"Ice Apple",
"JubJub Coconut Juice",
"Deluxe Elephante Cake",
"Raspberry Jam",
"Red Picnic Hamper",
"Chocolate Coated Tangy Cheese",
"Golden Caviar",
"Purple Carrot",
"Carrot Crown",
"Fire Carrot",
"Deceptive Soup",
"Green Ham",
"Square Meat",
"Peanut Dash Stir Fry",
"Le Sausage",
"Apple Juice Sippy Cup",
"Nimmo Day Fruit Cake",
"Polka Carrot",
"Seaweed Flotsam Burger",
"Peppered Salmon Dish",
"Fruit Tart",
"Flied Rice",
"Olivetato",
"Strawberry Taco",
"Wocky Steak",
"Breakfast Cake",
],
"gold");
// Add one or more words to the dictionary with a specified class
function defwords(words, which_class) {
for (var i = 0; i < words.length; i++) {
var w = words[i].replace(/^=/, "");
patterns.push(new RegExp("([^a-zA-Z])(" + w + ")([^a-zA-Z])",
words[i].match(/^=/) ? "g" : "gi"));
classes.push(which_class);
}
}
// Quote HTML metacharacters in body text
function quoteHTML(s) {
s = s.replace(/&/g, "&");
s = s.replace(/</g, "<");
s = s.replace(/>/g, ">");
return s;
}
// Add one or more CSS style rules to the document
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) {
return;
}
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
// Apply highlighting replacements to a text sequence
var curpat; // Hidden argument to repmatch()
var changes; // Number of changes made by repmatch()
function repmatch(matched, before, word, after) {
changes++;
return before + '<span class="' + classes[curpat] + '">' + word + '</span>' + after;
}
function highlight(s) {
s = " " + s;
for (curpat = 0; curpat < patterns.length; curpat++) {
s = s.replace(patterns[curpat],
repmatch);
}
return s.substring(1);
}
// We only modify HTML/XHTML documents
if (document.contentType &&
(!(document.contentType.match(/html/i)))) {
return;
}
// Highlight words in body copy
var textnodes = document.evaluate("//body//text()", document, null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < textnodes.snapshotLength; i++) {
var node = textnodes.snapshotItem(i);
/* Test whether this text node appears within a
<style>, <script>, or <textarea> container.
If so, it is not actual body text and must
be left alone to avoid wrecking the page. */
if (node.parentNode.tagName != "STYLE" &&
node.parentNode.tagName != "TEXTAREA" &&
node.parentNode.tagName != "SCRIPT") {
/* Many documents have large numbers of empty text nodes.
By testing for them, we avoid running all of our
regular expressions over a target which they can't
possibly match. */
if (!(node.data.match(/^\s*$/))) {
var s = " " + node.data + " ";
changes = 0;
var d = highlight(quoteHTML(s));
if (changes > 0) {
var rep = document.createElement("span");
rep.innerHTML = d.substring(1, d.length - 1);
node.parentNode.replaceChild(rep, node);
}
}
}
}
})();