Urgent.News

What's breaking now, across thousands of outlets.

Tech

Publishing to Medium Without APIs Using Chrome Extensions

When publishing platforms deprecate their developer APIs, automated syndication pipelines break. Technical bloggers and content engineers writing in local Markdown editors or static site generators are forced to manually copy and paste articles, re-format code blocks, re-upload inline graphics, and re-enter canonical URLs. Existing automation workarounds often rely on headless browser runners…

When publishing platforms stop providing developer APIs, automated pipelines for sharing content break down. Content creators who write in Markdown editors or static site generators are forced to manually copy, reformat code blocks, replace images, and re-enter URLs for each article. Some workarounds use headless browser tools like Puppeteer or Playwright in continuous integration servers, but these require storing sensitive login information on remote machines.

This can trigger security checks or require additional authentication steps. The article explores an alternative method that uses a Chrome extension running inside the user's already-logged-in browser. By building a Manifest V3 Chrome extension, developers can transfer formatted content into modern web editors without needing remote servers or storing private credentials.

Traditional automated systems act like API endpoints, trying to mimic user actions in headless environments. However, these face increased scrutiny from platforms using advanced detection methods. The extension-based approach keeps the user logged into the publishing platform, injecting scripts into the active tab where a valid session already exists.

This avoids the need for headless runners, password storage, and remote infrastructure while remaining entirely client-side. Updating stateful rich text editors is challenging because platforms use frameworks like Draft.js, Slate, or ProseMirror that maintain their own JavaScript models of the DOM. Directly modifying the DOM doesn't update the framework's internal state, causing the editor to overwrite changes when the user types or saves.

The article provides a code example showing how to locate the editor container, focus it, create a selection, and use native JavaScript commands to insert HTML while preserving the editor's format. The extension also handles attribution by extracting the original article's canonical URL and adding the necessary metadata or footer attribution before finalizing the draft.

This preserves the original source's domain authority and allows readers to trace back to the primary publication. By handling all processing locally inside the browser, client-side Chrome extensions eliminate privacy concerns related to sending article content or session data to external servers.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Seven posts on DEV, 74 views, and the one comment I never answered

I joined DEV on September 9 and posted seven articles over the next nineteen days. Together they have 74 views and 3 reactions. The last two have zero views each. Zero is a strange number. Not "low".

  • User posted seven articles on DEV between September 10-28
  • Articles collectively garnered 74 views and 3 reactions
  • Two posts received zero views, author analyzed data for reason

More from Friday 2 October →