Giter Site home page Giter Site logo

serv-inc / safe-search Goto Github PK

View Code? Open in Web Editor NEW
23.0 5.0 5.0 2.99 MB

Sets the built-in adult content filter (most often: safe search) on Google, YouTube, Bing, Yahoo, DuckDuckGo, Startpage, Dogpile, Yandex, Vimeo, Reddit, Ecosia, Dailymotion, Qwant, and Patreon.

License: Mozilla Public License 2.0

JavaScript 92.31% Makefile 0.33% HTML 0.74% CSS 0.16% Python 6.39% Shell 0.08%
firefox-extension chrome-extension safesearch google yahoo bing duckduckgo youtube startpage dogpile

safe-search's Introduction

Extension: Enforce Safe Search / Adult Content Filter

Sets the built-in adult content filter (most often: safe search) on Google, YouTube, Bing, Yahoo, DuckDuckGo, Startpage, Dogpile, Yandex, Vimeo, Reddit, Ecosia, Dailymotion, Qwant, Patreon, and Onesearch.

https://img.shields.io/amo/v/sas.svg https://img.shields.io/chrome-web-store/v/fiopkogmohpinncfhneadmpkcikmgkgc.svg

Versions

6.4.1: Had Bug on Qwant

fixed due to #49, thanks!

7.0.0: Was no longer on Chrome Web Store, and was not working on retry in Chrome

6.4.0: Lacked Brave Search

6.3.0: Lacked youtube no-op mode

as requested in #39

6.2.1: Failed on Google after to page ids

6.2.0: Lacked onesearch.com adult block

Thanks to https://github.com/jawad-lotfi

6.1.0: Failed on Youtube-under18-mode after their change

6.0.0: Failed on Qwant after their update

5.2.0: Failed as Google’s search update broke safe search in chrome

5.1.0: Failed by reloading on non-reload-necessary sites

5.0.0: Did not allow Vimeo filter customization

  • this enforces a minimum while preserving your settings

4.7.3: Failed in DuckDuckGo for POST requests

4.7.2: Failed on Qwant

4.7.1: Failed on DuckDuckGo on Chrome

after update on their part

4.6.2: Also failed on Bing

4.6.1: Failed on DuckDuckGo

4.6.0: Options page was uglier

  • value lenient was harder to understand
  • lacked link to explanation of values

4.5.0: Firefox storage failed

4.4.0: Lacked Patreon adult block

4.3.5: Failed on DuckDuckGo when using POST

so POST is disabled for now. If you want/need it, you can raise an issue or update #17.

4.3.4: Firefox failed on Quant

due to CORS implementation

4.3.0: Chrome complained about uri.includes

4.2.3: Broke Google Drive

4.2.2: Was exploitable

credits to @sfrauenfelder

4.2.1: Broke everything

4.2.0

Might have added URL search parameter twice

4.1.2

Broke Google docs

4.1.1

Failed on first search on quant.com

4.1.0

Lacked Qwant.com

Currently, this uses strict mode. If moderate mode works for you, you can file an issue to change this.

4.0.1

Failed to correctly set the option from the UI.

4.0.0

Lacked

Youtube-configuration. Youtube offers at least three safe search settings:

  • no adult content
  • moderate safe search
  • strict safe search

This extension previously only selected moderate safe search.

3.6.1

Failed

for google maps shown via another url than maps.google.com

3.6.0

Lacked

slightly cleaner code (indexOf)

3.5.1

Failed

generally due to using wrong method

3.5.0

Lacked

dailymotion.com support

3.4.2

Failed

to search on google play and to show google maps

3.4.1

Offended

Google’s Chrome Web Store reviewers due to too many supported sites (too many keywords in description)

3.4.0

Lacked

basic ecosia.org support

3.3.0

Lacked

application-id for firefox (required for MS global install)

Had

mismatched name on FF and Chrome

3.2.0

Lacked

basic reddit support

3.1.0

Lacked

extension short name and image attribution

3.0.0

Added

vimeo

2.3.0

Changed

did not work on Google Chrome’s/Chromium’s omnibox search

2.2.0

Added

yandex.com

2.1.0

Changed

code file lacked license mention

2.0.0

Changed

Version bump: a copy of my version 0.1.0 at mozilla has version 1.0.

0.2.1

Added

dogpile.com

0.2.0

Added

startpage.com, ixquick.com

0.1.0

Added

youtube

0.0.1

1st: google, bing, yahoo, duckduckgo

Uses

Icons

Libraries

Test

Selenium

Services

./meta/pictures/Browserstack-logo.svg

safe-search's People

Contributors

jawad-lotfi avatar serv-inc avatar trollepierre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

safe-search's Issues

Extension breaks Google Docs & Google Sheets in Firefox

As of the past few weeks, Google Docs and Google Sheets will load a document but then sit with a message saying "Trying to connect..." forever. Disabling this Enforce SafeSearch extension resolves the issue.

I'm running Firefox 62.0 on Ubuntu 18.04.

Youtube issues

Youtube comments are broken in most of videos, restraint mode
"Les commentaires de cette vidéo sont masqués, car cette dernière est en mode restreint."

And some video ask me to have a Google app account (and i'm logged in).

When I disable the extension, everything is good, I thought it was my tampermonkey messing it.

Using https://www.youtube.com.

password

no password protection so easily disabled :(

Huh?

Ur app (ext) is poorly described. The support link to GitHub has little information on it. There r no reviews. What's w all that?

Automatic Disconnect on Youtube

When I login to youtube, the panel on the right side is automatically opened and clicked to disconnect me.
I have to disable the extension to keep logged in.

Chromium Version 76.0.3809.100

Bulletproof installation Windows Chrome: easier method

I found that the following works to automatically install and disable uninstall of the extension, according to this page:
http://cloud.google.com/docs/chrome-enterprise/policies/?policy=ExtensionInstallForcelist

Create this key path in the Registry Editor (regedit.exe):
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallForcelist\1
Maybe you need another number than 1, if you have other forced extensions.

In there, update the Default value to:

Name: Default
Type: REG_SZ
Data: fiopkogmohpinncfhneadmpkcikmgkgc;https://clients2.google.com/service/update2/crx

No need to download Group Policies, I believe.
I couldn't get the existing instructions to work.

Please update the wiki instructions. You don't have to mention my name or id.

Please add OneSearch.com

Hello, I have left a similar request on the Firefox AddOns page to which you answered by asking how safesearch is enforced without the add on.
I tried searching with all 3 filters and compared the urls and here's what I found:
In the url of the search result, there is a vm parameter that can have 3 values. I found out that vm=r is strict, vm=i is moderate and vm=p is off.

After looking at your code I noticed that it looks like the following setting in background.js :

else if ( /search.yahoo.*\/search/.test(uri) ) {
    return _meta_add(uri, ["vm"], ["r"]);

I'm thinking that the fix is really just a duplicate of the one above but for onesearch.com.

Again, thanks for this very useful add-on!

4.3.1 makes browser console appears whenever youtube is opened

Upon starting firefox, the first time youtube is opened the browser console will open up. It will not reappear until firefox is fully closed and opened again.

It looks like it has to do with the alerts added on lines 87, 88, and 104 of addon/background.js as these were changed in commit 289cd66 but I may be wrong about this

google drive problems

When i disable the plugin, my drive loads fine, when i enable it my drive doesn't load very well. Any idea how to fix this? Maybe if there is a way to enable "exceptions" on google drive that could help.

Wiki for macOS

Hi.
I am in the process of deploying the extension on Mac with Firefox. Would you have a wiki for that too? Thank you.

Vimeo filter should be more flexible

The Vimeo filter, as it stands right now, disables the submit button on the mature content dialog, so that the user cannot change settings.

Its chief drawback is that it does not allow the user to enforce stricter settings such as disabling sexually suggestive content, profanities, or disabling mature content all together.

The filter only hides nudity.

One more mode for youtube ?

Youtube "Under 18" mode is not really "under 18" since, as a user, I can login with a google account and just set my age to be over 18 (even if I am not really over 18). So, do you think it would be possible to add a mode which is "really" under 18. I mean it would only allow all content which is not "over 18" (it is more content than the moderate mode), and always block the "over 18" content enven when I am logged in with a faked 18+ account ?

Complete Failure in Chrome browser

No enforcement at all in Chrome browser.
P.S. First filed the bug for duckduckgo, then checked vimeo, then cross-checked on both Windows and macOS. The extension is not working at all.

How do I install it on Microsoft Edge?

How do I get the plugin for Microsoft Edge and install it? I know that Edge is Chrome-based, but the add-on not in Microsoft Edge Store, nor on Chrome Web Store.

Browser: Microsoft Edge (Chromium?)
OS: Windows 10 64-bit

Youtube Strictness not saving

The youtube setting always come back to "lenient". I save, close the module tab or close firefox, then, when I come back, the setting is still "lenient".
(By the way, I do not understant what is lenient)

Allow Youtube configuration

Youtube has several settings: very strict, moderate, no adult content only. Very strict is little children-content only. Moderate blocks "offensive" content like some political speech. Then, YouTube requires a login for adult content. This should be blocked at least. There should be a switch to choose between these three modes. See also the review by cucumber at https://addons.mozilla.org/en-US/firefox/addon/sas/reviews/.

Windows, Chrome, Qwant: user can override safesearch by manupilating url

When using Chrome 64-bit on Windows, and using qwant.com, the user can override safe search by manupilating the url.
Adding "&safesearch=0" to the url, it displays unsafe results.

For other browsers and search engines, the extension checks the url; at least for Windows, Firefox&chrome, and duckduckgo. Please do something similar for chrome+qwant.

How to preset settings?

I'm installing in my organization your wonderful addon, on FireFox 60 ESR.

I wan to 'preset' for users the youtube strictness level, but seems that option are not saved on prefs (about:preferences) and so i don't know how to preset it via '.js' prefs file.

Can yiu give me some hint? Thanks.

Option to whitelist websites / disable youtube filter

It would be useful if one could whitelist websites, such as YouTube.
My problem with the YT filter is that it sometimes blocks the comments section while the video can normally play.
Using the <18 filter option is not a choice if I want to keep subscriptions working.

Google search page loads twice on Chrome

When the extension is enabled, the google result page for a search term appears to load twice. It looks like the extension triggers a postback right after the page is loaded. The behavior can easily be observed by repeating several searches and toggling the extension on and off for comparison.
I can reproduce this on the latest version of Chrome browser and Safe Search version 5.

Remove same param from uri (solution included)

In the function _add_if_neccesary there is a to do:
// todo: should also remove same param, (and maybe add & or ? depending)
This function solves the to do (tested in Firefox Quantum 62.0.3 (64 bit), duckduckgo).
function _add_or_replace(uri, par, val) {
var f = '((\\?)' + par + '=[^&]+&|&' + par + '=[^&]+)';
var t = uri.replace(new RegExp(f, 'gi'), '\$2');
return t + '&' + par + '=' + val;
}
It first sets up a regular expression f, then replaces the par=val with nothing, effectively removing the parameter. Then it adds the required par=val.
The regular expression matches

  • either "par=val&" directly after the question mark: (\?)' + par + '=[^&]+&
  • or "par=val" after an ampersand: &' + par + '=[^&]+

The replace function pastes back the question mark (\$2) if the first case was matched.
Hope this helps!

Wiki "Bulletproof installation" has some issues

In the Wiki, the topic "Bulletproof installation" has some issues, certainly for Firefox 66.0.5 64-bit on Windows.

  1. The url to the xpi must be updated with every release :-( I guess this applies to every OS.
  2. The policies.json file has a syntax error: the last comma "," should be removed (after the id).
  3. It could be added that on Windows 10, the directory "distribution" must be located in the same directory where the Firefox executable is located, so the full file path is probably
    C:\Program Files\Mozilla Firefox\distribution\policies.json
    or
    C:\Program Files (x86)\Mozilla Firefox\distribution\policies.json
  4. It could be added that one can check if the policy is active, by going to "about:policies".

For version 4.7.3 of the add-on, policies.json should be as follows:

{
  "policies": {
    "Extensions": {
      "Install": [
        "https://addons.mozilla.org/firefox/downloads/file/2337765/enforce_safesearch-4.7.3-an+fx.xpi"
      ],
      "Locked": [
        "{b52acdad-e4a6-44da-afc9-9bd22572db99}"
      ]
    }
  }
}

Vimeo filter not working ?

On Vimeo, I search "nude" for example and I can see videos tagged with the "MATURE" red rectangle icon.
The Vimeo filter is not working ?

Not working in Firefox + DuckDuckGo

I have a hosts file block for the other search engines so I cant test it with them.

OS: Mac OS 10.13.6 (17G65)
Browser: Firefox Quantum 61.0.2 (64-bit)

It used to work for DuckDuckGo, but now when I go and search for adult content, safe search is not forced at 'Strict', and it allows me to temporarily or permanently disable safe search.

I have tried removing / rebooting / adding the extension back but to no avail

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.