This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.addEventListener("DOMContentLoaded", function() { | |
| let devfolioOptions = { | |
| buttonSelector: "#devfolio-apply-now", | |
| key: "tezindia-harappa" | |
| }; | |
| let script = document.createElement("script"); | |
| script.src = "https://devfolio.surge.sh/applynow.min.js"; | |
| document.head.append(script); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function replaceText(find, replace){ | |
| const regex = new RegExp(find, "gi"); | |
| const contents = document.querySelectorAll('p,li,span,h1,h2,h3,h4,h5,h6'); | |
| for(const snippet of contents){ | |
| snippet.textContent = snippet.textContent.replace(regex, replace); | |
| } | |
| } | |
| chrome.runtime.onMessage.addListener(function(message){ | |
| if(message.action === 'REPLACE_TEXT'){ | |
| replaceText(message.find, message.replace); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const replacelyForm = document.getElementById("replacely-form"); | |
| const searchText = document.getElementById("search"); | |
| const replaceText = document.getElementById("replace"); | |
| replacelyForm.onsubmit = function(e){ | |
| e.preventDefault(); | |
| chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { | |
| chrome.tabs.sendMessage(tabs[0].id, {action: "REPLACE_TEXT", find: searchText.value, replace: replaceText.value}); | |
| window.close(); | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <link rel = "stylesheet" | |
| type = "text/css" | |
| href = "popup.css" /> | |
| </head> | |
| <body> | |
| <div class="wrap"> | |
| <h1>Replacely</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function replaceText(){ | |
| const FIND = "the"; | |
| const REPLACE_WITH = "replacely"; | |
| const regex = new RegExp(FIND, "gi"); | |
| const contents = document.querySelectorAll('p,li,span,h1,h2,h3,h4,h5,h6'); | |
| for(const snippet of contents){ | |
| snippet.textContent = snippet.textContent.replace(regex, REPLACE_WITH); | |
| } | |
| } | |
| chrome.runtime.onMessage.addListener(function(message){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const iconRules = [{ | |
| conditions: [ | |
| new chrome.declarativeContent.PageStateMatcher({ | |
| pageUrl: {hostEquals: 'medium.com'}, | |
| }) | |
| ], | |
| actions: [new chrome.declarativeContent.ShowPageAction()] | |
| }]; | |
| chrome.declarativeContent.onPageChanged.removeRules(undefined, function() { | |
| chrome.declarativeContent.onPageChanged.addRules(iconRules); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const FIND = "the"; | |
| const REPLACE_WITH = "replacely"; | |
| const regex = new RegExp(FIND, "gi"); | |
| const contents = document.querySelectorAll('p,li,span,h1,h2,h3,h4,h5,h6'); | |
| for(const snippet of contents){ | |
| snippet.textContent = snippet.textContent.replace(regex, REPLACE_WITH); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "Replacely", | |
| . | |
| . | |
| . | |
| "content_scripts": [ | |
| { | |
| "matches": ["https://medium.com/*"], | |
| "js": ["contentScript.js"] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "Replacely", | |
| "version": "0.1", | |
| "description": "An extension to replace text in medium articles", | |
| "manifest_version": 2, | |
| "page_action": { | |
| "default_icon": { | |
| "16": "images/replacely16.png", | |
| "32": "images/replacely32.png", | |
| "48": "images/replacely48.png", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "Replacely", | |
| "version": "0.1", | |
| "description": "An extension to replace text in medium articles", | |
| "manifest_version": 2, | |
| "page_action": { | |
| "default_icon": { | |
| "16": "images/replacely16.png", | |
| "32": "images/replacely32.png", | |
| "48": "images/replacely48.png", |
NewerOlder