sakusaku3939 / DeepLAndroid

Unofficial Android App for DeepL Translator
MIT License
334 stars 18 forks source link

hide it (request) #104

Closed Wjxfi closed 4 weeks ago

Wjxfi commented 1 year ago

JavaScript is used to hide all but the most necessary elements.

it is not true

There's a deepl pro ad and "download for free" ad (hide it)

I am also very concerned about the company reviews below (like everything else I have listed above).

raniesantos commented 1 year ago

Screenshot_20230705-082945 Needs update to hide promotions.

sudoshindo commented 1 month ago

@sakusaku3939

PLEASE UPDATE THE APP USING THIS CODE

PLEASE PUBLISH TO F-DROID AFTERWARDS

THIS ONLY TOOK ME 1 HOUR BY THE WAY

IT DIDN'T TAKE ME OVER A YEAR TO FIGURE OUT HOW TO FIX IT

init.js

Appending additional styles to the <head> is more reliable than constantly calling .hide() because this will ALWAYS hide elements even if they are not immediately loaded and this makes setTimeout unnecessary.

$('a').css('pointer-events', 'none');
$('*').css('-webkit-tap-highlight-color', 'rgba(0,0,0,.1)');

$('head').append(`<style>
    [class*="LogoLink-module--translatorLink--"] ~ div,
    [class^="ProductNavigation-module--container--"] + div,
    [class^="SideMenuButton-module--menuButton--"],
    [class^="BasePageHeader-module--exContainer--"] + div > div:first-child,
    h2#translation-modes-heading + div > div:first-child,
    div[data-testid="translator"] span:nth-child(3),
    footer,
    div[data-testid="chrome-extension-toast"],
    div[data-testid="firefox-extension-toast"] {
        display: none !important;
        visibility: hidden;
        height: 0;
        width: 0;
        overflow: hidden;
    }
</style>`);
sakusaku3939 commented 1 month ago

@sudoshindo Sorry. And thank you so much for working on the fix! I haven't used this app for over 2 years now, so I had no motivation to update it. I can make this fix myself, but if you want to keep your name as a contributor, please create a pull request here. I will make the release to F-Droid.

P.S. I believe this fix will solve the problem for a while. However, the DeepL site requires periodic CSS modifications as the design is updated regularly. (So we have made 7~8 major revisions in the past)

sakusaku3939 commented 4 weeks ago

I have updated to v8.2 and will be released an update to F-Droid in a few days. https://github.com/sakusaku3939/DeepLAndroid/releases/tag/v8.2

If you see the promotion again, please open a new Issue. Thank you @sudoshindo.