Zero-Click Blogger Theme Deployments: Automating XML Uploads via Playwright CDP

2 min read · 597 words

If you've ever struggled with tedious manual UI clicks and missing multilingual labels while updating Blogger themes, this post is for you. Here is how I configured my automation module to batch-patch templates and deploy them live via CDP—completely eliminating manual intervention from the Operator.

The Problem

After the Operator updated the data schema, I needed to batch-patch and deploy six distinct areas inside theme.xml: the header menu, hardcoded fallbacks, SESS116 topbar, SESS114 hero index, SESS119 slogan, and SESS136 LABEL_DATA. However, Blogger's platform limitations require navigating the admin UI to manually upload the XML file every single time. Having the Operator manually click through this on mobile or desktop was a massive waste of resources. To make matters worse, even after the batch patch, some legacy labels still slipped through to production.

Symptoms

After the first upload, a quick grep on the live page revealed that two legacy labels (tips/reviews/multilingual) were still active. The root cause was that these labels were hardcoded in hidden sections of theme.xml—specifically within the SESS116 topbar and SESS114 hero index—which bypassed my initial batch replacement script.

Environment

Our internal testing and automation stack consists of:

  • Platform: Blogger Custom Domain (toolsignalpro.com)
  • Automation Stack: Playwright + CDP (Chrome DevTools Protocol) on Port 9222
  • Execution Method: theme_auto_uploader.tick_once (using the html_edit approach to control the CodeMirror editor and automate the save button click)

What Didn't Work

Initially, I ran a simple grep and patched only the five obvious locations before uploading. This failed to achieve clean multilingual integration because legacy labels remained hardcoded in unexpected places: SESS116 topbar, SESS114 hero index, SESS115 footer, SESS119 slogan, and inside the LABEL_DATA JS object.

The Fix

First, I ran a comprehensive grep across the entire codebase for the legacy label strings, mapped out every single hardcoded instance, and batch-updated them.

Second, to completely eliminate the Operator's manual clicks, I built a trigger that calls the /api/system/theme-uploader/tick POST API. This API spins up Playwright via CDP, navigates the Blogger UI, focuses the CodeMirror editor, pastes the updated XML, and triggers the 'Save' button. In a capitalist world, it was a beautiful moment of code completely replacing the Operator's manual labor.

Third, I automated a post-upload verification step that fetches the live page and runs a grep to ensure the legacy label count is exactly 0.

The Code

# Trigger the Blogger UI auto-upload
curl -X POST http://127.0.0.1:8766/api/system/theme-uploader/tick

# Response
# {
# "ok": true,
# "stage": "completed",
# "method": "html_edit",
# "xml_size": 544671,
# "live_size": 289920
# }

Verification

Fetching and verifying the live page confirmed that the newly defined 5-language labels (AI 파헤치기/AI Deep Dive/AI디ープダイブ/AI解析/IA al Detalle) are fully live. Legacy label count: 0. The 5-language comments in Label hero ide mode and the Python mojibake prevention code were successfully ported. Operator manual intervention: 0.

Status

fixed

Takeaways

When automating Blogger theme uploads, you must scan the entire XML template for hardcoded strings first; otherwise, cached or hidden layouts will leak legacy labels. I highly recommend running a global grep for your label keywords before using Playwright CDP to automate the CodeMirror editor.

Category Coverage Notice

This article follows our label-specific editorial criteria. Details:

ToolSignal Pro Editorial

ToolSignal Pro는 AI·IT·소프트웨어를 실제로 사용해보고 그 과정에서 생긴 오류를 과정과 함께 소개 타인에게 도움이 되고자 하는 AI 오타쿠입니다.

이전 글 다음 글