From 83e9c5ca8816b9ebef18d962733fad4d62671a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Norman=20Hauk=C3=A5s?= Date: Sat, 26 Sep 2015 11:43:02 +0200 Subject: [PATCH] extension now injects button that can trigger a popover --- background.js | 8 ++++++-- content_script.js | 9 ++++++++- manifest.json | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/background.js b/background.js index b4fbddc..5acd4a7 100644 --- a/background.js +++ b/background.js @@ -11,6 +11,10 @@ function updateIcon () { } } -chrome.browserAction.onClicked.addListener(updateIcon); +function initBackground () { + chrome.browserAction.onClicked.addListener(updateIcon); + updateIcon(); +} + +initBackground(); -updateIcon(); diff --git a/content_script.js b/content_script.js index 526b86c..01670fe 100644 --- a/content_script.js +++ b/content_script.js @@ -1 +1,8 @@ -console.log('hello world!'); +$(document).ready(function () { + console.log('hello world!'); + + $("body").append(''); + + $('[data-toggle="popover"]').popover(); +}); + diff --git a/manifest.json b/manifest.json index 06fd28e..fd43952 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,6 @@ "name": "Tag you're it", "description": "Make the meaning clear. This plugin enables semantic tagging of web content.", "version": "0.7", - "permissions": [""], "background": { "persistent": false, "scripts": ["background.js"] @@ -12,6 +11,7 @@ "css": ["bower_components/bootstrap/dist/css/bootstrap.min.css"], "js": [ "bower_components/jquery/dist/jquery.min.js", + "bower_components/bootstrap/js/tooltip.js", "bower_components/bootstrap/dist/js/bootstrap.min.js", "content_script.js"] }],