Permalink
Browse files

Create facebook.css

  • Loading branch information...
1 parent b7bdefe commit ffc38be7a91f34a61e03e63cfea543ff3d751f3f @J2TeaM J2TeaM committed Jan 20, 2017
Showing with 16 additions and 7 deletions.
  1. +12 −0 facebook.css
  2. +3 −7 facebook.js
  3. +1 −0 manifest.json
View
@@ -0,0 +1,12 @@
+/* Show Facebook Computer Vision Tags */
+.sfcvt {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ padding: 5px;
+ font-size: 12px;
+ line-height: 1.8;
+ background-color: rgba(0, 0, 0, 0.7);
+ color: #fff;
+ border-radius: 5px;
+}
View
@@ -21,7 +21,7 @@ const show_facebook_cv_tags = function(localeData) {
if (isCVTag) {
const tags = altText.slice(localeData.tag_prefix.length).split(localeRegex);
- let html = '<ul style="position:absolute;top:10px;right:10px;padding:5px;font-size:12px;line-height:1.8;background-color:rgba(0,0,0,0.7);color:#fff;border-radius:5px">';
+ let html = '<ul class="sfcvt">';
tags.forEach(function(tag) {
let prefix = '';
@@ -49,9 +49,7 @@ const show_facebook_cv_tags = function(localeData) {
*/
const initializePlugin = function(localeData) {
const observer = new MutationObserver(mutations => {
- mutations.forEach(mutation => {
- show_facebook_cv_tags(localeData);
- });
+ mutations.forEach(mutation => show_facebook_cv_tags(localeData));
});
const config = {
@@ -73,9 +71,7 @@ const makeLocaleRequest = function(localePath) {
fetch(chrome.extension.getURL(localePath))
.then(response => response.json())
.then(data => initializePlugin(data))
- .catch(err => {
- console.error('FB COMPUTER VISION TAGS ERROR', err);
- });
+ .catch(err => console.error('FB COMPUTER VISION TAGS ERROR', err));
};
/**
View
@@ -16,6 +16,7 @@
},
"content_scripts": [{
"matches": ["http://www.facebook.com/*", "https://www.facebook.com/*"],
+ "css": ["facebook.css"],
"js": ["facebook.js"],
"run_at": "document_idle",
"all_frames": false

0 comments on commit ffc38be

Please sign in to comment.