Do more on the web, with a fast and secure browser!

Download Opera browser with:

  • built-in ad blocker
  • battery saver
  • free VPN
Download Opera

Save as MHTML adding suspect content to the file.

  • @leocg said in Save as MHTML adding suspect content to the file.:

    @disappointeduser Next time please store those long text dumps somewhere else and just post the link to it here.
    A post with probably more then 100 lines may be kinda annoying, specially for those on mobile.

    I am sorry for the inconvenience, but I found no way to attach a file.

    I'll do the next time......

  • @leocg said in Save as MHTML adding suspect content to the file.:

    @disappointeduser Do you get the same results with the ad-blocker turned off?

    Dear @leocg,

    I have just checked it.....and your suspects were right......
    With the ad-blocker turned off, all that links created by Opera (I insist in that) and inserted in the <head> as a <style> of the web page saved as .mhtml, are not stored in the .mhtml file.
    GOOD POINT......thanks....

    I suppose that now a discussion will arise: Can this be considered as a bug?
    From my point of view, YES as the saved file is not an image of the web page.

  • @disappointeduser You don't attach it, you upload it to a host and then post the link to it here.
    For long text, you may try https://pastebin.com/

  • @disappointeduser It was discussed here already, I just remembered that and asked about the ad-blocker.

  • @disappointeduser we think that it's something we shouldn't remove when generating .mhtml to not confuse users with different content than they've expected in case some ads were blocked. But to avoid any confusion on concerns we will try to add some comments to this code to indicate that it comes from Opera Adblocker.

  • @mgeffro said in Save as MHTML adding suspect content to the file.:

    @disappointeduser we think that it's something we shouldn't remove when generating .mhtml to not confuse users with different content than they've expected in case some ads were blocked. But to avoid any confusion on concerns we will try to add some comments to this code to indicate that it comes from Opera Adblocker.

    Please, add option to not save adblock rules. This could be advanced option, no problem with that - but I greatly prefer saving original page, not adjusted one. Maybe I even need to look at saved page in another browser with all ads flashing? 🙂

  • @leocg said in Save as MHTML adding suspect content to the file.:

    @disappointeduser It was discussed here already, I just remembered that and asked about the ad-blocker.

    Dear @leocg,

    did you get any answer to your questions from the development team?

    I have been analyzing the stored .mhtml file and it looks that as you said, all those links included in the file are related with the Opera integrated ad-blocker.
    Maybe it is the list of URLs that the add-blocker uses to recognize and ban a link in a web page.
    If this is true, I am not sure if this list of URLs should be disclosed to the public as the advertisers could use it to circumvent the ad-blocker.

    Besides of this, the links are included between HEAD tags as a STYLE, just after TITLE tags but while the html standard says the style tags should have this format:

    <style type="text/css"></style>

    the Opera browser is saving the added STYLE tags in this way:

    <style type=3D"text/css">
    </style><=

    and no, that ending "<=" characters are not my typing error

    As I said, in between those style tags is where the list of URLs is included in this kind of format:
    :root a[href^=3D"http://ad-apac.doubleclick.net/"]=, :root .GKJYXHBF2 > .GKJYXHBE2 > .GKJYXHBH5,
    :root a[href^=3D"http://www.amazon.co.uk/exec/obidos/external-search?"],
    :root #\5f _mom_ad_2, :root #rhs_block .mod > .luhb-div > div[data-async-type=3D"updateHotelBookingModule"=
    ],

    etc...etc.....

    From my point of view all of this is something it shouldn't happen. It is no sense to store that information related to ad-blocker in the .mhtml file.

    Should I open a bug report or some moderator will generate it from this post?

    Regards.....

  • Dear @mgeffro,

    the question is what are all those links?
    I could understand that Opera saved the specific links that have blocked if any, but saving all the list even if the visited and saved page has no ads is a bit no sense....

    Firefox doesn't save any extra information when the ad-blocker plugin is activated.

    INMHO, It will be as simple as when Opera saves the page with the ad-block activated to simply remove the suspected advertisement links from the pages according to the rules in ad-block but there is no need to save all the list.

    What efect will have those .mhtml files with antivirus software? Could it trigger an alert because some suspicious link?

    What do you think?

    Regards..

  • MHTML is similar to email, as you are viewing the actual saved file it is encoded like email would be (known as "quoted printable") Characters that are not safe in email are converted to an equals sign followed by a hex code - and since the = is reserved for this use, any original = must be converted to =3D (3D being the hex code for =].

    The developers replied to us that removing the code would change the appearance of the page (if the page was supposed to contain any of the content blocked by Opera), and their idea was that it should look the same as it was displayed. If you don't want Opera to add that code you can (temporarily) disable the ad-blocker. They haven't clearly said they wouldn't change it - I mean, my argument to them would be that Opera will do all that when I view the saved file anyway - but of course if you (or someone you send it to) view the file in another browser you'd have all the ads back.

  • @disappointeduser said in Save as MHTML adding suspect content to the file.:

    the Opera browser is saving the added STYLE tags in this way..:

    The markup is encoded as Quoted-Printable. That's all you're seeing there. mhtml files are basically just eml files where the main page is an attachment in the source.

  • Dear @sgunhouse,

    I understand the URL encoding and that =3D stuff.....what attract my attention is that "<=" after the "</style>" tag.

    I understand what they said about the appearance of the page but what I expect is to save what I see in the browser.
    If the adblocker is activated, in some way, what it is showing to me is not the original page as the ads has been removed, so why is so important to respect the original spaces coming from the ads if the page is saved to file while the browser is removing those same spaces when the page is originally displayed in the browser?
    Did you get my point of view? If the argument is valid for saving it shoud be also valid for browsing.

  • @disappointeduser What questions?

    As said, it's already been addressed so there's no need to report it.

  • @leocg .....

    Ahhhh, got it.....

    I didn't understand you correctly the first time...

    But it depends if this is considered a bug or a feature as @sgunhouse, suggested.

    Thanks.

  • @disappointeduser But what you see on the browser is generated by that code from the ad-blocker.

  • @disappointeduser said in Save as MHTML adding suspect content to the file.:

    my attention is that "<=" after the "</style>" tag.

    The '<' is the starting bracket for the LINK element on the next line. The '=' and the newline after it is just breaking up things into another line to meet line-length limits.

  • @leocg Exactly! And that appearance is altered respect to the original page with ads, so why not save the page altered as is being displayed?

    When a section is removed from a page by the adblocker, its space is not reserved in the displayed page, so the page appeareance is altered. This new page layout is what it should be saved...exactly what is displayed... with the ad links directly eliminated and tha ads space eliminated or reduced as displayed.

    Maybe there is something I am missing because this sound so obvious for me...sorry.

  • @burnout426 said in Save as MHTML adding suspect content to the file.:

    @disappointeduser said in Save as MHTML adding suspect content to the file.:

    my attention is that "<=" after the "</style>" tag.

    The '<' is the starting bracket for the LINK element on the next line. The '=' and the newline after it is just breaking up things into another line to meet line-length limits.

    It is not....it looks it belongs to the </head> tag.
    So the same question is still around. Is it compliant with the standard to break the head tag inserting a "=" sign plus CRLF just before "/head>". The "=" sign is supposed to replace non printable caracter followed by its hex code, so if any it should be something like:

    <=OD=OA
    /head>

    Am I wrong?

  • No, the = before a linebreak means there was no break in the original, so you can't encode it as a non-printable character (since it wasn't there).

  • @disappointeduser said in Save as MHTML adding suspect content to the file.:

    It is not....it looks it belongs to the </head> tag.

    Which part of the source that you previously posted are you referring to then?

    As sgunhouse said though, '=' at the end of a line (as in, '=' + raw CR + raw LF) is okay. It's like a soft wrap that can happen right in the middle of an open tag or end tag etc. When the quoted-printable is decoded, it'll be put back together.

Log in to reply