Brent Montrose | 22 Jun 19:11 2015
Picon

Content Blocking

Hello

I have another question regarding Content Blocking, and performance.

For the "Action" types of "css-display-none" are the following two
examples effectively the same (hiding content on example.com)?

Example 1:

"trigger": {
"url-filter": "^https?://([^/]*\.)?example\.com"
},
"action": {
"type": "css-display-none",
"selector": ".ad"
}

Example 2:
"trigger": {
"url-filter": "^https?://",
"if-domain": "example.com"
},
"action": {
"type": "css-display-none",
"selector": ".ad"
}

Example 1 explicitly specifies the domain in the "url-filter".
Example 2 uses a very generic "url-filter", but utilizes the
"if-domain" restrict which domains the selector would be applied to.
(Continue reading)

Robert Jones | 17 Jun 06:54 2015
Picon

Testing content blocking

Hi All,

I'm trying out some things with the new content blocking features in WebKit.  Does anyone have suggestions on how to test content blocking beyond the following technique:

 - Create JSON file
 - Force iOS Simulator to reload the JSON file
 - Reload the web page in mobile Safari
 - Visually observe the correct behavior

I've noticed, when using 'css-display-none', that the blocked content is still visible in the web inspector, although the content is correctly blocked in mobile Safari.  So, I don't think I can observe the output of the web inspector.

Is it possible to hook into some other part of WebKit to find out what's being blocked?  Are there perhaps some unit tests that do something like this?

Thanks,
Rob
<div><div dir="ltr">Hi All,<div><br></div>
<div>I'm trying out some things with the new content blocking features in WebKit.&nbsp; Does anyone have suggestions on how to test content blocking beyond the following technique:</div>
<div><br></div>
<div>&nbsp;- Create JSON file</div>
<div>&nbsp;- Force iOS Simulator to reload the JSON file</div>
<div>&nbsp;- Reload the web page in mobile Safari</div>
<div>&nbsp;- Visually observe the correct behavior</div>
<div><br></div>
<div>I've noticed, when using 'css-display-none', that the blocked content is still visible in the web inspector, although the content is correctly blocked in mobile Safari.&nbsp; So, I don't think I can observe the output of the web inspector.</div>
<div><br></div>
<div>Is it possible to hook into some other part of WebKit to find out what's being blocked?&nbsp; Are there perhaps some unit tests that do something like this?</div>
<div><br></div>
<div>Thanks,</div>
<div>Rob</div>

</div></div>
Brent Montrose | 17 Jun 01:34 2015
Picon

Content Hiding in Safari 9

Hello,

Thanks for the quick reply to my earlier email ("A few questions about
Content Blocking Extensions in Safari 9").

I have another question regarding content hiding and the use of the
"if-domain" option in the "trigger" field.  I would like some
clarification regarding the usage of the "if-domain" and the
"unless-domain" options.

Below is some sample code which successfully hides a few ads on slashdot.org.

     var rules = [];
      //general rule 1
      rules.push({
        "action": {
            "selector": ".adwrap",
            "type": "css-display-none"
        },
        "trigger": {
            "url-filter": ".*"
        }
      });
      //general rule 2
      rules.push({
        "action": {
            "selector": "div[id^=\"div-gpt-ad-\"]",
            "type": "css-display-none"
        },
        "trigger": {
            "url-filter": ".*"
        }
      });
      //site specific rule 3
      rules.push({
        "action": {
          "selector": "#banner-wrap",
          "type": "css-display-none"
        },
        "trigger": {
          "url-filter": ".*",
         // "if-domain": ["slashdot.org"]
         }
      });
      safari.extension.setContentBlocker(rules);

The above code works, and successfully hides the ads.  However, if the
"if-domain" line is uncommented in site specific rule 3 above, the ads
are displayed.  Is there a way to write the above three rules so that
the ads on slashdot.org are hidden?  In other words, I would like:
- all three rules applied to slashdot.org
- rule 1 and 2 applied to any other site / domain
- only rule 3 applied to slashdot.org

Is there a way to write the rules to do this?  If so, how?

Thanks in advance for your help.
Brent Montrose | 16 Jun 19:03 2015
Picon

A few questions about Content Blocking Extensions in Safari 9

I've been reading the article on new content blocking mechanism, introduced with Safari 9 (https://www.webkit.org/blog/3476/content-blockers-first-look/), and the emails regarding the subject. The article and email response was helpful, but I have a few additional questions.1. Does an extension need to set the rules each time the browser / extension starts up? Or, will Safari 9 cache the rules between restarts?
2. Is there a easy way to pause content blocking & hiding for a short period time? Or rather, what is the recommended approach to pause content blocking? For example, a user navigates to a web site and wishes to view all of the content on that page without white-listing the specific site. If I understand correctly, to pause content blocking, the extension would currently need to set / submit an empty JavaScript object to effectively clear the current rules. Then, later, when the user wishes to enable content blocking again (un-pause), the extension would need to set all of previous rules (which could be expensive).-- Brent


<div><div dir="ltr">
<span>I've been reading the article on new </span><span>content blocking mechanism, introduced with Safari </span><span>9 (</span><a href="https://www.webkit.org/blog/3476/content-blockers-first-look/">https://www.webkit.org/blog/3476/content-blockers-first-look/</a>), and the emails regarding the subject. The article and email response was helpful, but I have a few additional questions.<span>1.  Does an extension need to set the rules each time the browser / extension starts up?  Or, will Safari 9 cache the rules between restarts?</span><br>2.  Is there a easy way to pause content blocking &amp; hiding for a short period time? Or rather, what is the recommended approach to pause content blocking?   For example, a user navigates to a web site and wishes to view all of the content on that page without white-listing the specific site.  If I understand correctly, to pause content blocking, the extension would currently need to set / submit an empty JavaScript object to effectively clear the current rules.  Then, later, when the user wishes to enable content blocking again (un-pause), the extension would need to set all of previous rules (which could be expensive).-- Brent<br><br><br>
</div></div>
Sebastian Noack | 14 Jun 16:07 2015

Feedback about Content Blocking Extensions from Adblock Plus

Hi there,

I'm from Adblock Plus, and just read the articleon the WebKit website [1] about the new content blocking mechanism, introduced with Safari 9. Thanks for providing some details. But I identified following shortcomings that would effectively make the new mechanism insufficient for us, or anybody supporting our filters [2], which are used by popular filter lists, including EasyList:

1. Most importantly, our exception rules are recursive. For example ||example.com$document prevents not only documents loaded from example.com being blocked. But also resources loaded as part of that document or in any of it's subframes or their subframes wouldn't be blocked either. However, this logic doesn't seem to be possible with the ignore-previous-rules action. A recursive flag would come handy here.

2. There doesn't seem to be a way to distinguish between document and subdocument requests. While Adblock Plus blocks frames, it never blocks the top level document, so that users can still access the resource that is blocked, when entering its URL in the address bar.

3. A dedicated resource-type for XMLHttpRequests, objects (requests loading a Flash element) and object subrequests (subsequent requests issued by a Flash object) would certainly be useful as well. EasyList has quite some filters specifically checking for those.

4. Adblock Plus uses filters subscriptions (periodically downloaded filter lists, like EasyList) as well as filters added by the user, to decide what to block. So we'd need a way to dynamically configure block lists. I saw the pre-release announcements mentioning the new setContentBlocker API for this purpose. I couldn't find any details on that, but I assume that you can simply pass in a block list as JavaScript object? But note that we'd need a way to invalidate previously set blocking rules when filters in Adblock Plus changed. However, a way to add new rules without flushing the previously set block list would be extremely useful in some cases as well. So ideally, this API should let you modify the block list in place.


Sebastian
<div><div dir="ltr">Hi there,<div><br></div>
<div>I'm from Adblock Plus, and just read the articleon the WebKit website [1] about the new content blocking mechanism, introduced with Safari 9. Thanks for providing some details. But I identified following shortcomings that would effectively make the new mechanism insufficient for us, or anybody supporting our filters [2], which are used by popular filter lists, including EasyList:</div>
<div><br></div>
<div>1. Most importantly, our exception rules are recursive. For example ||<a href="http://example.com">example.com</a>$document prevents not only documents loaded from <a href="http://example.com">example.com</a> being blocked. But also resources loaded as part of that document or in any of it's subframes or their subframes wouldn't be blocked either. However, this logic doesn't seem to be possible with the&nbsp;ignore-previous-rules action. A recursive flag would come handy here.</div>
<div><br></div>
<div>2. There doesn't seem to be a way to distinguish between document and subdocument requests. While Adblock Plus blocks frames, it never blocks the top level document, so that users can still access the resource that is blocked, when entering its URL in the address bar.</div>
<div><br></div>
<div>3. A dedicated resource-type for XMLHttpRequests, objects (requests loading a Flash element) and object subrequests (subsequent requests issued by a Flash object) would certainly be useful as well. EasyList has quite some filters specifically checking for those.</div>
<div><br></div>
<div>4. Adblock Plus uses filters subscriptions (periodically downloaded filter lists, like EasyList) as well as filters added by the user, to decide what to block. So we'd need a way to dynamically configure block lists. I saw the pre-release announcements mentioning the new&nbsp;setContentBlocker API for this purpose. I couldn't find any details on that, but I assume that you can simply pass in a block list as JavaScript object? But note that we'd need a way to invalidate previously set blocking rules when filters in Adblock Plus changed. However, a way to add new rules without flushing the previously set block list would be extremely useful in some cases as well. So ideally, this API should let you modify the block list in place.</div>
<div><br></div>
<div>[1]&nbsp;<a href="https://www.webkit.org/blog/3476/content-blockers-first-look/">https://www.webkit.org/blog/3476/content-blockers-first-look/</a>
</div>
<div>[2] <a href="https://adblockplus.org/filters">https://adblockplus.org/filters</a><br>
</div>
<div><br></div>
<div>Sebastian</div>
</div></div>
Eric Wing | 5 Jun 14:39 2015
Picon

Pushing binary data into a string (JSStringCreateWithCharacters, JSStringCreateWithUTF8CString)

I am using JavaScriptCore in an embedded application situation. I am
writing a binding between libcurl and JavaScriptCore.

Curl callbacks for data give back a char* buffer, which may be a
string or binary data. I want to push this data directly into
JavaScript as a string because I thought it would be easiest for
handling and the usually the typical usage is a non-binary string. And
my understanding is Javascript strings themselves can hold any kind of
data and don't suffer from the C terminator problem.

Since I have a char* buffer, JSStringCreateWithUTF8CString() has the
right type signature, but it assumes null termination and there isn't
a variation with an explicit size parameter. This is problematic if
either there is no NULL terminator or there are 0's in the data
stream.

JSStringCreateWithCharacters has a parameter for the number of
characters, but it uses a JSChar* instead of char*. I don't know how
to convert.

Is there a way I can get this through the bridge correctly?

Thanks,
Eric

P.S. For my callback bindings, I found the API
JSContextGetGlobalContext() invaluable. I found an old archived thread
suggesting it might be officially moved to public API. If it has not
already been moved, I would really like encourage this.
Thomas Brodt | 19 May 13:17 2015
Picon

[wincairo] test failures on build bot due to missing files in python installation

Hi all

the buildbot for the cairo release is red for some time now.
At least some of the failures seem to be the result of missing files in 
the python installation:

[622/1110]

webkitpy.port.linux_get_crash_log_unittest.GDBCrashLogGeneratorTest.test_generate_crash_log 
erred:
   Traceback (most recent call last):
     File

"C:\Users\Alex\Documents\WinCairoBot\win-cairo-release\build\Tools\Scripts\webkitpy\port\linux_get_crash_log_unittest.py", 
line 60, in test_generate_crash_log
       stderr, log = generator.generate_crash_log(None, None)
     File

"C:\Users\Alex\Documents\WinCairoBot\win-cairo-release\build\Tools\Scripts\webkitpy\port\linux_get_crash_log.py", 
line 73, in generate_crash_log
       cppfilt_proc = subprocess.Popen(['c++filt', ], 
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     File "C:\Python27\lib\subprocess.py", line 710, in __init__
       errread, errwrite)
     File "C:\Python27\lib\subprocess.py", line 958, in _execute_child
       startupinfo)
   WindowsError: [Error 2] The system cannot find the file specified

Maybe someone can fix the installation for the bot?

Thomas
Thomas Brodt | 19 May 09:16 2015
Picon

Re: [wincairo, 184378] Compiler error with VS2013 in TemplateRegistryKey

Hi Brent

currently I only did the windows update, so I have version 12.0.21005.1 REL.
I will update the version as you suggested and hope that the problem 
vanishes - fingers crossed.

Thanks for the hint!

Thomas

Am 15.05.2015 um 19:05 schrieb Brent Fulgham:
> Hi Thomas,
>
> I’m excited to see another person working with the Windows build!
>
> Are you running the current Update 4 for VS2013? I recently had to update our build machines to the
following revision to avoid similar ICE errors:
>
> Version 12.0.31101.00 Update 4
>
> Annoyingly, Windows Update does not automatically find and offer this update for your software. You need
to go to the MSDN site and download it.
>
> This is a free update for all versions of Visual Studio 2013 (including the ‘Express’ edition).
>
> I hope that helps!
>
> Thanks,
>
> -Brent
>
>> On May 15, 2015, at 4:00 AM, Thomas Brodt <thomas.brodt.lists <at> porabo.ch> wrote:
>>
>> Hello
>>
>> I have set up a new installation for compiling WebKit.
>> With a recent revision 184378 I get a VS2013 compiler error:
>>
>> offlineasm: Including file /home/thomas/Webkit/WebKitBuild/Debug_WinCairo/obj32/JavaScriptCore/DerivedSources/InitBytecodes.asm
>> offlineasm: Including file /home/thomas/WebKit/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
>> offlineasm: Including file /home/thomas/WebKit/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
>> offlineasm: offset extractor
/home/thomas/Webkit/WebKitBuild/Debug_WinCairo/obj32/JavaScriptCore/DerivedSources/LLIntDesiredOffsets.h
successfully generated.
>>        del "%ConfigurationBuildDir%\buildfailed"
>> LLIntOffsetsExtractor.cpp
>>
C:\cygwin\home\thomas\webkit\webkitbuild\debug_wincairo\include\private\javascriptcore\TemplateRegistryKey.h(65):
fatal error C1001: Interner Compilerfehler. [C:\cygwin\home\thomas\WebKit\Source\JavacriptCore\JavaScriptCore.vcxproj\LLInt\LLIntOffsetsExtractor\LLIntOffsetsExtractor.vcxproj]
>> (Compilerdatei 'msc1.cpp', Zeile 1325)
>>
>> TemplateRegistryKey seems to be quite new. Do others have problems with MS-VS, too?
>> Can anybody help me?
>> Thanks
>>
>> Thomas
>> _______________________________________________
>> webkit-help mailing list
>> webkit-help <at> lists.webkit.org
>> https://lists.webkit.org/mailman/listinfo/webkit-help
>
>

_______________________________________________
webkit-help mailing list
webkit-help <at> lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-help
Thomas Brodt | 15 May 13:00 2015
Picon

[wincairo, 184378] Compiler error with VS2013 in TemplateRegistryKey

Hello

I have set up a new installation for compiling WebKit.
With a recent revision 184378 I get a VS2013 compiler error:

  offlineasm: Including file 
/home/thomas/Webkit/WebKitBuild/Debug_WinCairo/obj32/JavaScriptCore/DerivedSources/InitBytecodes.asm
  offlineasm: Including file 
/home/thomas/WebKit/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
  offlineasm: Including file 
/home/thomas/WebKit/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
  offlineasm: offset extractor

/home/thomas/Webkit/WebKitBuild/Debug_WinCairo/obj32/JavaScriptCore/DerivedSources/LLIntDesiredOffsets.h 
successfully generated.
        del "%ConfigurationBuildDir%\buildfailed"

LLIntOffsetsExtractor.cpp
C:\cygwin\home\thomas\webkit\webkitbuild\debug_wincairo\include\private\javascriptcore\TemplateRegistryKey.h(65): 
fatal error C1001: Interner Compilerfehler. 
[C:\cygwin\home\thomas\WebKit\Source\JavacriptCore\JavaScriptCore.vcxproj\LLInt\LLIntOffsetsExtractor\LLIntOffsetsExtractor.vcxproj]
  (Compilerdatei 'msc1.cpp', Zeile 1325)

TemplateRegistryKey seems to be quite new. Do others have problems with 
MS-VS, too?
Can anybody help me?
Thanks

Thomas
santhosh dhamodharan | 12 May 18:54 2015
Picon

Re: Building webKit with Visual Studio 2015

how to unsubscribe from webkit mails  

On Tue, May 12, 2015 at 10:06 PM, Sharma, Rupali <rupsharma-Ciceq19BNLo@public.gmane.org> wrote:

Hello,

 

We are looking into building our port of WebKit (called EAWebKit) using Visual Studio 2015. We would like to know your thoughts or if any experiences with the same.

 

Thanks,

Rupali

EA WebKit Team.


_______________________________________________
webkit-help mailing list
webkit-help-L0Ma0HqZfWbDNr2163bV0w@public.gmane.orgg
https://lists.webkit.org/mailman/listinfo/webkit-help


<div>
<div dir="ltr">how to unsubscribe from webkit mails &nbsp;</div>
<div class="gmail_extra">
<br><div class="gmail_quote">On Tue, May 12, 2015 at 10:06 PM, Sharma, Rupali <span dir="ltr">&lt;<a href="mailto:rupsharma <at> ea.com" target="_blank">rupsharma@...</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">
<div>
<a href="https://www.boxbe.com/overview" target="_blank"></a>

  Sharma, Rupali (<a href="mailto:rupsharma@..." target="_blank">rupsharma@...</a>) is not on <a href="https://www.boxbe.com/approved-list?tc_serial=21307469785&amp;tc_rand=1489505928&amp;utm_source=stf&amp;utm_medium=email&amp;utm_campaign=ANNO_MWTP&amp;utm_content=001&amp;token=kIGtQuVJZUYbIBbOiSGocaSVNNrDS0yNI31zR9tMzQsndBp5sUfVsjmjPDaJBPaI&amp;key=eb21Qzz4XszdOz0BL7IDHqFR03f4mV2RcQ8P7tNj9pE%3D" target="_blank">your Guest List</a>

    | <a href="https://www.boxbe.com/anno?tc_serial=21307469785&amp;tc_rand=1489505928&amp;utm_source=stf&amp;utm_medium=email&amp;utm_campaign=ANNO_MWTP&amp;utm_content=001&amp;token=kIGtQuVJZUYbIBbOiSGocaSVNNrDS0yNI31zR9tMzQsndBp5sUfVsjmjPDaJBPaI&amp;key=eb21Qzz4XszdOz0BL7IDHqFR03f4mV2RcQ8P7tNj9pE%3D" target="_blank">Approve sender</a>
    | <a href="https://www.boxbe.com/anno?tc_serial=21307469785&amp;tc_rand=1489505928&amp;utm_source=stf&amp;utm_medium=email&amp;utm_campaign=ANNO_MWTP&amp;utm_content=001&amp;dom&amp;token=kIGtQuVJZUYbIBbOiSGocaSVNNrDS0yNI31zR9tMzQsndBp5sUfVsjmjPDaJBPaI&amp;key=eb21Qzz4XszdOz0BL7IDHqFR03f4mV2RcQ8P7tNj9pE%3D" target="_blank">Approve domain</a>
<br>
</div>
<br><div lang="EN-US" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal"><span>Hello,</span></p>
<p class="MsoNormal"><span>&nbsp;</span></p>
<p class="MsoNormal"><span>We are looking into building our port of WebKit (called EAWebKit) using Visual Studio 2015. We would like to know your thoughts or if
 any experiences with the same.</span></p>
<p class="MsoNormal"><span>&nbsp;</span></p>
<p class="MsoNormal"><span>Thanks,</span></p>
<p class="MsoNormal"><span>Rupali</span></p>
<p class="MsoNormal"><span>EA WebKit Team.</span></p>
</div>
</div>

<br>_______________________________________________<br>
webkit-help mailing list<br><a href="mailto:webkit-help@...">webkit-help@...g</a><br><a href="https://lists.webkit.org/mailman/listinfo/webkit-help" target="_blank">https://lists.webkit.org/mailman/listinfo/webkit-help</a><br><br>
</blockquote>
</div>
<br>
</div>
</div>
Sharma, Rupali | 12 May 18:36 2015

Building webKit with Visual Studio 2015

Hello,

 

We are looking into building our port of WebKit (called EAWebKit) using Visual Studio 2015. We would like to know your thoughts or if any experiences with the same.

 

Thanks,

Rupali

EA WebKit Team.

<div>
<div class="WordSection1">
<p class="MsoNormal"><span>Hello,<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>We are looking into building our port of WebKit (called EAWebKit) using Visual Studio 2015. We would like to know your thoughts or if
 any experiences with the same.<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>Thanks,<p></p></span></p>
<p class="MsoNormal"><span>Rupali<p></p></span></p>
<p class="MsoNormal"><span>EA WebKit Team.<p></p></span></p>
</div>
</div>

Gmane