From d6c3d3541d8450ffdef747a2a5917ad6e6dd2ff1 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Wed, 13 Jul 2016 13:34:40 +0200 Subject: [PATCH] disable the loading of social buttons --- CHANGELOG.md | 4 ++++ block-social-footer.js | 13 +++++++++++++ glotdict.js | 2 -- manifest.json | 10 ++++++++-- 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 block-social-footer.js diff --git a/CHANGELOG.md b/CHANGELOG.md index abe9471..d6fd612 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +#1.1.3 +* Improvement: The FB, Twitter and Google+ button are not loaded + + #1.1.2 * Improvement: If there is only one string is opened automatically * Fix: Remove the ' on comments to avoid problems diff --git a/block-social-footer.js b/block-social-footer.js new file mode 100644 index 0000000..3254721 --- /dev/null +++ b/block-social-footer.js @@ -0,0 +1,13 @@ +chrome.webRequest.onBeforeRequest.addListener( + function (requestDetails) { + if (requestDetails.originUrl.indexOf("translate.wordpress.org") !== -1) { + return { + cancel: true + }; + } + }, + { + urls: ["https://platform.twitter.com/*", "https://www.facebook.com/plugins*", "https://apis.google.com/js/platform.js"] + }, + ["blocking"] + ); \ No newline at end of file diff --git a/glotdict.js b/glotdict.js index 6e41bce..f6a7761 100644 --- a/glotdict.js +++ b/glotdict.js @@ -314,8 +314,6 @@ jQuery(document).ready(function () { }); } - // Remvoe the social button in the bottom - jQuery('#wporg-footer ul:last-child').remove(); gd_add_project_links(); gd_add_button(); diff --git a/manifest.json b/manifest.json index 1376b46..2a8090e 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "description": "Add custom dictonaries on translate.wordpress.org", "manifest_version": 2, "name": "GlotDict", - "version": "1.1.2", + "version": "1.1.3", "homepage_url": "https://github.com/Mte90/GlotDict", "icons": { "16": "icons/icon-16.png", @@ -27,6 +27,12 @@ "web_accessible_resources": [ "glotdict.js", "keymaster.js" - ] + ], + "permissions": [ + "webRequest", "webRequestBlocking" + ], + "background": { + "scripts": ["block-social-footer.js"] + } }