Skip to content

Instantly share code, notes, and snippets.

View alexnj's full-sized avatar

Alex N. Jose alexnj

View GitHub Profile
@alexnj
alexnj / non-cleanedup.patch
Last active April 13, 2023 17:58
3P Cookie access Use Counter.
diff --git a/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom b/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom
index 0d8c64ff3be78..08008cf9b66b0 100644
--- a/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom
+++ b/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom
@@ -3881,6 +3881,8 @@ enum WebFeature {
kGamepadTouchSurfaceDimension = 4540,
kSandboxViaFencedFrame = 4541,
kVisibilityStateObserver = 4542,
+ kCookieGetThirdParty = 4543,
+ kCookieGetFirstParty = 4544,
@alexnj
alexnj / performance-measure.patch
Last active April 10, 2023 23:16
Patch adding detail to perf measures
diff --git a/third_party/blink/renderer/core/timing/performance_user_timing.cc b/third_party/blink/renderer/core/timing/performance_user_timing.cc
index 1056e5c6f04d7..3f7a36ba36450 100644
--- a/third_party/blink/renderer/core/timing/performance_user_timing.cc
+++ b/third_party/blink/renderer/core/timing/performance_user_timing.cc
@@ -210,12 +210,28 @@ PerformanceMeasure* UserTiming::Measure(ScriptState* script_state,
WTF::AddFloatToHash(hash, start_time);
WTF::AddFloatToHash(hash, end_time);
+ v8::Local<v8::Context> context =
+ performance_->GetExecutionContext()->GetIsolate()->GetCurrentContext();
@alexnj
alexnj / local changes.patch
Created March 27, 2023 18:42
trace event patch
diff --git a/base/trace_event/common/trace_event_common.h b/base/trace_event/common/trace_event_common.h
index f2ee4d36b317d..7d5731053bbd7 100644
--- a/base/trace_event/common/trace_event_common.h
+++ b/base/trace_event/common/trace_event_common.h
@@ -965,6 +965,13 @@ struct BASE_EXPORT TraceTimestampTraits<::base::TimeTicks> {
TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \
TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY, \
arg1_name, arg1_val)
+#define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP2( \
+ category_group, name, id, timestamp, arg1_name, arg1_val, \
{
"transformations": [
[1, "h2:nth-of-type(1)", 6, "Documentation"],
[2, "img[alt$=\"Logo\"]", 8, "alt", "Marketing alt text"]
]
}
This file has been truncated, but you can view the full file.
{
"lighthouseVersion": "10.0.0",
"requestedUrl": "https://www.theverge.com/",
"mainDocumentUrl": "https://www.theverge.com/",
"finalDisplayedUrl": "https://www.theverge.com/",
"finalUrl": "https://www.theverge.com/",
"fetchTime": "2023-02-16T16:34:40.104Z",
"gatherMode": "navigation",
"runWarnings": [],
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
This file has been truncated, but you can view the full file.
{
"lighthouseVersion": "10.0.1",
"requestedUrl": "https://www.theverge.com/",
"mainDocumentUrl": "https://www.theverge.com/",
"finalDisplayedUrl": "https://www.theverge.com/",
"finalUrl": "https://www.theverge.com/",
"fetchTime": "2023-02-16T16:34:40.104Z",
"gatherMode": "navigation",
"runWarnings": [],
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
This file has been truncated, but you can view the full file.
{
"lighthouseVersion": "9.5.0",
"requestedUrl": "https://theverge.com/",
"mainDocumentUrl": "https://www.theverge.com/",
"finalDisplayedUrl": "https://www.theverge.com/",
"finalUrl": "https://www.theverge.com/",
"fetchTime": "2022-12-16T01:34:12.691Z",
"gatherMode": "navigation",
"runWarnings": [
"The page may not be loading as expected because your test URL (https://theverge.com/) was redirected to https://www.theverge.com/. Try testing the second URL directly."
@alexnj
alexnj / ab-demo-todomvc-03.json
Last active November 9, 2022 15:25
Revised A/B spec - Demos
{
"control": {
"url": "https://todomvc.com/examples/react",
"cache": {
}
},
"variants": [
{
"weight": 0.5,
"url": "https://todomvc.com/examples/react",
@alexnj
alexnj / vividmotion.co
Last active October 17, 2022 17:49
gpu comparison with and without gpu
$ node core/scripts/compare-runs.js --name base --collect -n 20 \
--urls https://vividmotion.co/
$ node core/scripts/compare-runs.js --name nogpu --collect -n 20 \
--lh-flags='--chrome-flags=--disable-gpu' --urls https://vividmotion.co/
$ node core/scripts/compare-runs.js --name base --name nogpu --compare
┌─────────┬───────────────────────────────────────────────┬───────────────────────────┬─────────────────────┬─────────┬──────────────────────┬────────┐
│ (index) │ name │ url │ mean │ mean Δ │ cv │ cv Δ │
├─────────┼───────────────────────────────────────────────┼───────────────────────────┼─────────────────────┼─────────┼──────────────────────┼────────┤
│ 0 │ 'lh:runner:gather' │ 'https://vividmotion.co/' │ '8808.4 -> 39237.2' │ 30428.8 │ '1.404 -> 0.581' │ -0.8 │
@alexnj
alexnj / ab-configurations
Last active November 9, 2022 15:45
A/B test configurations origin
# ab-configurations
transformations follow the structure
[
[bitField of flags, CSS selector to modify, operation, ...payloads]
]
Available bit flags are:
0x1 - PRE_UA - Changes are applied prior to User Agent
0x2 - ON_UA - Changes are applied on UA