-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.js
More file actions
40 lines (35 loc) · 9.6 KB
/
background.js
File metadata and controls
40 lines (35 loc) · 9.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// This is a list of 1,271 emojis, which I believe is current as of 2019-05-08.
// This is not getting updated, unless some really cool emojis come out.
let emojis = '😀 😁 😂 🤣 😃 😄 😅 😆 😉 😊 😋 😎 😍 😘 😗 😙 😚 ☺️ 🙂 🤗 🤩 🤔 🤨 😐 😑 😶 🙄 😏 😣 😥 😮 🤐 😯 😪 😫 😴 😌 😛 😜 😝 🤤 😒 😓 😔 😕 🙃 🤑 😲 ☹️ 🙁 😖 😞 😟 😤 😢 😭 😦 😧 😨 😩 🤯 😬 😰 😱 😳 🤪 😵 😡 😠 🤬 😷 🤒 🤕 🤢 🤮 🤧 😇 🤠 🤥 🤫 🤭 🧐 🤓 😈 👿 🤡 👹 👺 💀 ☠️ 👻 👽 👾 🤖 💩 🙊 💋 💘 💝 💖 💗 💓 💞 💕 💌 ❣️ 💔 ❤️ 🧡 💛 💚 💙 💜 🖤 💟 💍 💎 💐 💒 👶 🧒 👦 👧 🧑 👨 👱♂️ 🧔 👩 👱♀️ 🧓 👴 👵 👨⚕️ 👩⚕️ 👨🎓 👩🎓 👨🏫 👩🏫 👨⚖️ 👩⚖️ 👨🌾 👩🌾 👨🍳 👩🍳 👨🔧 👩🔧 👨🏭 👩🏭 👨💼 👩💼 👨🔬 👩🔬 👨💻 👩💻 👨🎤 👩🎤 👨🎨 👩🎨 👨✈️ 👩✈️ 👨🚀 👩🚀 👨🚒 👩🚒 👮♂️ 👮♀️ 🕵️♂️ 🕵️♀️ 💂♂️ 💂♀️ 👷♂️ 👷♀️ 🤴 👸 👳♂️ 👳♀️ 👲 🧕 🤵 👰 🤰 🤱 👼 🎅 🤶 🧙♂️ 🧙♀️ 🧚♂️ 🧚♀️ 🧛♂️ 🧛♀️ 🧜♂️ 🧜♀️ 🧝♂️ 🧝♀️ 🧞♂️ 🧞♀️ 🧟♂️ 🧟♀️ 🙍♂️ 🙍♀️ 🙎♂️ 🙎♀️ 🙅♂️ 🙅♀️ 🙆♂️ 🙆♀️ 💁♂️ 💁♀️ 🙋♂️ 🙋♀️ 🙇♂️ 🙇♀️ 🤦 🤦♂️ 🤦♀️ 🤷 🤷♂️ 🤷♀️ 💆♂️ 💆♀️ 💇♂️ 💇♀️ 👤 👥 👫 👬 👭 👩❤️💋👨 👨❤️💋👨 👩❤️💋👩 👩❤️👨 👨❤️👨 👩❤️👩 👨👩👦 👨👩👧 👨👩👧👦 👨👩👦👦 👨👩👧👧 👨👨👦 👨👨👧 👨👨👧👦 👨👨👦👦 👨👨👧👧 👩👩👦 👩👩👧 👩👩👧👦 👩👩👦👦 👩👩👧👧 👨👦 👨👦👦 👨👧 👨👧👦 👨👧👧 👩👦 👩👦👦 👩👧 👩👧👦 👩👧👧 🤳 💪 👈 👉 ☝️ 👆 🖕 👇 ✌️ 🤞 🖖 🤘 🤙 🖐️ ✋ 👌 👍 👎 ✊ 👊 🤛 🤜 🤚 👋 🤟 ✍️ 👏 👐 🙌 🤲 🙏 🤝 👂 👃 👀 👁️ 🧠 👅 👄 🚶♂️ 🚶♀️ 🏃♂️ 🏃♀️ 💃 🕺 👯♂️ 👯♀️ 🧖♂️ 🧖♀️ 🧗♂️ 🧗♀️ 🧘♂️ 🧘♀️ 🛌 🕴️ 🗣️ 🤺 🏇 ⛷️ 🏂 🏌️♂️ 🏌️♀️ 🏄♂️ 🏄♀️ 🚣♂️ 🚣♀️ 🏊♂️ 🏊♀️ ⛹️♂️ ⛹️♀️ 🏋️♂️ 🏋️♀️ 🚴♂️ 🚴♀️ 🚵♂️ 🚵♀️ 🏎️ 🏍️ 🤸 🤸♂️ 🤸♀️ 🤼 🤼♂️ 🤼♀️ 🤽 🤽♂️ 🤽♀️ 🤾 🤾♂️ 🤾♀️ 🤹 🤹♂️ 🤹♀️ 🎖️ 🏆 🏅 🥇 🥈 🥉 ⚽ ⚾ 🏀 🏐 🏈 🏉 🎾 🎳 🏏 🏑 🏒 🏓 🏸 🥊 🥋 🥅 ⛸️ 🎣 🎿 🛷 🥌 🎯 🎱 📢 📣 📯 🔔 🎼 🎵 🎶 🎙️ 🎚️ 🎛️ 🎧 📻 🎷 🎸 🎹 🎺 🎻 🥁 💽 💿 📀 🎥 🎞️ 📽️ 🎬 📺 📷 📸 📹 📼 🍇 🍈 🍉 🍊 🍋 🍌 🍍 🍎 🍏 🍐 🍑 🍒 🍓 🥝 🍅 🥥 🥑 🍆 🥔 🥕 🌽 🌶️ 🥒 🥦 🥜 🌰 🍞 🥐 🥖 🥨 🥞 🧀 🍖 🍗 🥩 🥓 🍔 🍟 🍕 🌭 🥪 🌮 🌯 🥙 🥚 🍳 🥘 🍲 🥣 🥗 🍿 🥫 🍱 🍘 🍙 🍚 🍛 🍜 🍝 🍠 🍢 🍣 🍤 🍥 🍡 🥟 🥠 🥡 🍦 🍧 🍨 🍩 🍪 🎂 🍰 🥧 🍫 🍬 🍭 🍮 🍯 🍼 🥛 ☕ 🍵 🍶 🍾 🍷 🍸 🍹 🍺 🍻 🥂 🥃 🥤 🥢 🍽️ 🍴 🥄 🏺 😺 😸 😹 😻 😼 😽 🙀 😿 😾 🙈 🙉 🐵 🐒 🦍 🐶 🐕 🐩 🐺 🦊 🐱 🐈 🦁 🐯 🐅 🐆 🐴 🐎 🦄 🦓 🦌 🐮 🐂 🐃 🐄 🐷 🐖 🐗 🐽 🐏 🐑 🐐 🐪 🐫 🦒 🐘 🦏 🐭 🐁 🐀 🐹 🐰 🐇 🐿️ 🦔 🦇 🐻 🐨 🐼 🐾 🦃 🐔 🐓 🐣 🐤 🐥 🐦 🐧 🕊️ 🦅 🦆 🦉 🐸 🐊 🐢 🦎 🐍 🐲 🐉 🦕 🦖 🐳 🐋 🐬 🐟 🐠 🐡 🦈 🐙 🐚 🦀 🦐 🦑 🐌 🦋 🐛 🐜 🐝 🐞 🦗 🕷️ 🕸️ 🦂 🌸 💮 🏵️ 🌹 🥀 🌺 🌻 🌼 🌷 🌱 🌲 🌳 🌴 🌵 🌾 🌿 ☘️ 🍀 🍁 🍂 🍃 🍄 ⌛ ⏳ ⚡ 🎆 🎇 🔇 🔈 🔉 🔊 🔕 🔒 🔓 🔏 🔐 🚮 🚰 ♿ 🚹 🚺 🚻 🚼 🚾 🛂 🛃 🛄 🛅 ⚠️ 🚸 ⛔ 🚫 🚳 🚭 🚯 🚱 🚷 📵 🔞 ⏭️ ⏯️ ⏮️ ⏸️ ⏹️ ⏺️ ⏏️ 🎦 🔅 🔆 📶 📳 📴 🔱 ℹ️ Ⓜ️ 🅿️ ⬆️ ↗️ ➡️ ↘️ ⬇️ ↙️ ⬅️ ↖️ ↕️ ↔️ ↩️ ↪️ ⤴️ ⤵️ 🔃 🔄 🔀 🔁 🔂 ▶️ ⏩ ◀️ ⏪ 🔼 ⏫ 🔽 ⏬ 🛀 👣 💣 🔪 🛢️ ⛽ 🚥 🚦 🚧 🛎️ ⛱️ 🔥 🎗️ 🎟️ 🎫 🔮 🎲 🎴 🎭 🖼️ 🎨 🎤 🔍 🔎 🕯️ 💡 🔦 🏮 📜 🔑 🗝️ 🔨 ⛏️ ⚒️ 🛠️ 🗡️ ⚔️ 🔫 🏹 🛡️ 🔧 🔩 ⚙️ 🗜️ ⚖️ ⛓️ ⚗️ 🔬 🔭 📡 💉 💊 🚪 🛏️ 🛋️ 🚽 🚿 🛁 🛒 🚬 ⚰️ ⚱️ 💠 💺 🎮 🕹️ 🎰 📱 📲 ☎️ 📞 📟 📠 💻 🖥️ 🖨️ ⌨️ 🖱️ 🖲️ 💾 📔 📕 📖 📗 📘 📙 📚 📓 📒 📃 📄 📰 🗞️ 📑 🔖 🏷️ 💰 💴 💵 💶 💷 💸 💳 💹 💱 ✉️ 📧 📨 📩 📤 📥 📦 📫 📪 📬 📭 📮 🗳️ ✏️ ✒️ 🖋️ 🖊️ 🖌️ 🖍️ 📝 💼 📁 📂 🗂️ 📅 📆 🗒️ 🗓️ 📇 📈 📉 📊 📋 📌 📍 📎 🖇️ 📏 📐 ✂️ 🗃️ 🗄️ 🗑️ 💅 👓 🕶️ 👔 👕 👖 🧣 🧤 🧥 🧦 👗 👘 👙 👚 👛 👜 👝 🛍️ 🎒 👞 👟 👠 👡 👢 👑 👒 🎩 🎓 🧢 ⛑️ 📿 💄 🌂 ☂️ 🎽 🚂 🚃 🚄 🚅 🚆 🚇 🚈 🚉 🚊 🚝 🚞 🚋 🚌 🚍 🚎 🚐 🚑 🚒 🚓 🚔 🚕 🚖 🚗 🚘 🚙 🚚 🚛 🚜 🚲 🛴 🛵 🚏 🛣️ 🛤️ ⛵ 🛶 🚤 🛳️ ⛴️ 🛥️ 🚢 ✈️ 🛩️ 🛫 🛬 🚁 🚟 🚠 🚡 🛰️ 🚀 🛸 🌍 🌎 🌏 🌐 🗺️ 🗾 🏔️ ⛰️ 🗻 🏕️ 🏖️ 🏜️ 🏝️ 🏞️ 🏟️ 🏛️ 🏗️ 🏘️ 🏚️ 🏠 🏡 🏢 🏣 🏤 🏥 🏦 🏨 🏩 🏪 🏫 🏬 🏭 🏯 🏰 🗼 🗽 ⛪ 🕌 🕍 ⛩️ 🕋 ⛲ ⛺ 🏙️ 🎠 🎡 🎢 🎪 ⛳ 🗿 💦 🌋 🌁 🌃 🌄 🌅 🌆 🌇 🌉 🌌 🌑 🌒 🌓 🌔 🌕 🌖 🌗 🌘 🌙 🌚 🌛 🌜 🌡️ ☀️ 🌝 🌞 🌟 🌠 ☁️ ⛅ ⛈️ 🌤️ 🌥️ 🌦️ 🌧️ 🌨️ 🌩️ 🌪️ 🌫️ 🌬️ 🌀 🌈 ☔ ❄️ ☃️ ⛄ ☄️ 💧 🌊 🎑 ⌚ ⏰ ⏱️ ⏲️ 🕰️ 🕛 🕧 🕐 🕜 🕑 🕝 🕒 🕞 🕓 🕟 🕔 🕠 🕕 🕡 🕖 🕢 🕗 🕣 🕘 🕤 🕙 🕥 🕚 🕦 🏧 🔙 🔚 🔛 🔜 🔝 🔰 ‼️ ⁉️ ❓ ❔ ❕ ❗ ™️ #️⃣ *️⃣ 0️⃣ 1️⃣ 2️⃣ 3️⃣ 4️⃣ 5️⃣ 6️⃣ 7️⃣ 8️⃣ 9️⃣ 🔟 💯 🔠 🔡 🔢 🔣 🔤 🅰️ 🆎 🅱️ 🆑 🆒 🆓 🆔 🆕 🆖 🅾️ 🆗 🆘 🆙 🆚 🈁 🈂️ 🈷️ 🈶 🈯 🉐 🈹 🈚 🈲 🉑 🈸 🈴 🈳 ㊗️ ㊙️ 🈺 🈵 💢 ♨️ 💈 ⚓ ♠️ ♥️ ♦️ ♣️ 💲 ☢️ ☣️ 🛐 ⚛️ 🕉️ ✡️ ☸️ ☯️ ✝️ ☦️ ☪️ ☮️ 🕎 🔯 ♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓ ⛎ ♀️ ♂️ ⚕️ ♻️ ⚜️ ©️ ®️ 👁️🗨️ 💤 💥 💨 💫 💬 🗨️ 🗯️ 💭 🕳️ 🚨 🛑 ⭐ 🎃 🎄 ✨ 🎈 🎉 🎊 🎋 🎍 🎎 🎏 🎐 🎀 🎁 🃏 🀄 🔋 🔌 🔗 📛 ⭕ ✅ ☑️ ✔️ ✖️ ❌ ❎ ➕ ➖ ➗ ➰ ➿ 〽️ ✳️ ✴️ ❇️ 〰️ 🔴 🔵 ⚪ ⚫ ⬜ ⬛ ◼️ ◻️ ◽ ◾ ▫️ ▪️ 🔶 🔷 🔸 🔹 🔺 🔻 🔘 🔲 🔳 🏻 🏼 🏽 🏾 🏿 🏁 🚩 🎌 🏴 🏳️ 🏳️🌈 🏴 🏴 🏴'.split(' ');
// Takes a string, returns it in mocking-case (random capitalization) and with all spaces replaced with a random emoji.
function shitpostify(pasta) {
pasta = pasta.split('').map(function(char) {
let randomCased = Math.round(Math.random());
let randomEmoji = emojis[Math.round(Math.random()*emojis.length)];
char = char.replace(' ', randomEmoji);
return char = randomCased ? char.toUpperCase() : char.toLowerCase();
}).join('');
if (confirm(`Copy to clipboard?\n\n${pasta}`)) {
copyToClipboard(pasta);
}
}
function copyToClipboard(text) {
let tempElement = document.createElement("textarea");
document.body.appendChild(tempElement);
tempElement.value = text;
tempElement.select();
document.execCommand("copy");
tempElement.parentNode.removeChild(tempElement);
}
chrome.runtime.onInstalled.addListener(function() {
chrome.contextMenus.create({
id: "shitpostify-menu",
title: "shItPosTiFY🚸HighLigHted🐨TEXT?",
contexts:["selection"]
});
});
chrome.contextMenus.onClicked.addListener(function(info, tab) {
if (info.menuItemId == "shitpostify-menu") {
shitpostify(info.selectionText);
}
});