Skip to content

Instantly share code, notes, and snippets.

View hjanuschka's full-sized avatar
🤖
-.-

Helmut Januschka hjanuschka

🤖
-.-
  • Vienna/Austria
View GitHub Profile
@hjanuschka
hjanuschka / browserjs-abort-fix.md
Created November 16, 2025 17:16
Fix for BrowserJS Abort Issue - V8 Termination Needs Yield Points

How to Fix BrowserJS Abort Issue - V8 Termination Needs Yield Points

Summary

Good news: CL 7110745 is working correctly (all 31 bots passed). The issue is that V8's TerminateExecution() can only interrupt JavaScript at yield points, and the current sitegeist wrapper doesn't create them.

The Problem

When you call chrome.userScripts.terminate(), it invokes v8::Isolate::TerminateExecution(). However, this only works when JavaScript yields control back to the event loop.

@hjanuschka
hjanuschka / 00-README.md
Last active November 12, 2025 22:00
Chromium macOS SDK Compatibility Patch - Fix for older SDKs missing kCGBitmapByteOrderInfoMask and kCGImageByteOrder32Host

Tested with: Xcode 15.4 (SDK 14.5)

Apply

cd /path/to/chromium/src
git apply 1.patch
autoninja -C out/Default chrome
@hjanuschka
hjanuschka / userscripts_cancel_api_v2.md
Created October 31, 2025 09:29
chrome.userScripts.execute() with Cancellation - How Await and Cancel Work Together

chrome.userScripts.execute() with Cancellation Support

New API Overview

The chrome.userScripts.execute() now supports script cancellation through execution IDs:

1. Execute with optional executionId (handle pattern)

const results = await chrome.userScripts.execute({
 js: [{ code: wrapperCode }],
@hjanuschka
hjanuschka / skia_chromium_fix.cpp
Last active October 15, 2025 07:57
Chromium-compatible Skia text rendering fix - matching LCD subpixel rendering
#include "skia.h"
#include <stdexcept>
#include <wrl/client.h>
#include <dwrite.h>
Skia::Skia() {
mgr = SkFontMgr_New_DirectWrite(); // Platform-specific for Windows
}
# BLACKFIRE.io setup
RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
&& wget -O /tmp/blackfire-probe.tar.gz https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \
&& mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini
@hjanuschka
hjanuschka / README.md
Last active November 23, 2018 18:57
unittests against ClassicPress

Setup testing environment

ClassicPress

bin/install-cp-tests.sh  DBNAME DBUSER DBPASS DBIP:DBPORT master false

master == the version

@hjanuschka
hjanuschka / PrettyPrinter.php
Created November 22, 2018 10:36
phpunit pretty print
<?php
namespace Test;
class PrettyPrinter extends \PHPUnit\TextUI\ResultPrinter implements \PHPUnit\Framework\TestListener
{
private $headerPrinted = false;
/**
* Function name is slightly deceiving because it is called at the beginning of the
* unit test summary (after all tests have run)
*/
@hjanuschka
hjanuschka / media-views.js
Created August 14, 2018 08:06
media-views.js compat indicator
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
<?php
acf_add_local_field_group(array(
'key' => 'group_5878908956b61',
'title' => __('Media: Copyright', 'kmm-media'),
'fields' => array(
array(
'key' => 'field_587890c1ce938',
'label' => __('Copyright', 'kmm-media'),
'name' => 'copyright',
array (
'key' => 'field_585149317aa44',
'label' => 'Fixposition',
'name' => 'ressort_template_position',
'type' => 'ressort_picker',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '10%',