NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name Wordpress images picker previews dark background
// @namespace http://tampermonkey.net/
// @version 2025-06-03
// @description Adds dark background to Wordpress images picker previews
// @author Nexus <artem.nexus94@gmail.com>
// @include /^https?:\/\/.+\.[^\/]+\/wp-admin\/post.php.*$/
// @grant none
// @updateURL https://openuserjs.org/meta/Nexus/Wordpress_images_picker_previews_dark_background.meta.js
// @downloadURL https://openuserjs.org/install/Nexus/Wordpress_images_picker_previews_dark_background.user.js
// @copyright 2025, Nexus (https://openuserjs.org/users/Nexus)
// @license MIT
// ==/UserScript==
(function() {
'use strict';
var head = document.getElementsByTagName('head');
if (!head.length) {
return;
}
head = head[0];
var runtimeStyle = document.createElement('style');
runtimeStyle.id = 'WordpressImagesViewerDarkBackground--runtime-styles';
runtimeStyle.textContent = '.wp-core-ui .attachment-preview:before {background: #000}';
head.appendChild(runtimeStyle);
})();