Created
December 31, 2020 14:02
-
-
Save JustDravee/fb737b26ded29cf2457343a9f842fec6 to your computer and use it in GitHub Desktop.
popup.js de l'extension Medium ReStyle
This file contains 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 () { | |
// Récupération de la couleur sélectionnée | |
var color = $('#fontColor').val(); | |
$('#fontColor').on("change paste keyup", function () { | |
color = $(this).val(); | |
}); | |
// En cas de click sur #btnChange : envoyer le Message "changeColor" avec l'information de la couleur sélectionnée | |
$('#btnChange').click(function () { | |
chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) { | |
chrome.tabs.sendMessage(tabs[0].id, { todo: "changeColor", clickedColor: color }); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment