I also found the Tom Chambers' Tech Blog - "How to write a simple content modifying Chrome extension" but I can't get the popup button to work.
I have to pin the Extension to see the button, is there a way to show it by default?
Once there it shows the popup when clicked but when I click the button nothing happens.
content.js
var copy = $('body').clone()
$('th:contains("Died")').parent().hide()
chrome.runtime.onMessage.addListener(function() {
$('body').html($(copy))
})
popup.js
$(document).ready(function() {
$('.deadify').click(function() {
chrome.runtime.sendMessage({ undo: true })
})
})
manifest.json
{
"name": "Timesheet Hellper",
"description": "Intacct Extension",
"version": "1.0",
"manifest_version": 2,
"browser_action": {
"default_icon": {
"16": "logo_16_T.png",
"48": "logo_48_T.png",
"128": "logo_128_T.png"
},
"default_popup":"popup.html"
},
"icons": { "16": "logo_16_T.png",
"48": "logo_48_T.png",
"128": "logo_128_T.png" },
"content_scripts": [{
"css": ["styles.css"],
"js": ["jquery-2.2.0.min.js", "content.js", "popup.js"],
"run_at": "document_end"
}]
}