Change theme-color meta attribute has no effect in Chromium









up vote
1
down vote

favorite












I'm running a website in a desktop / app window in Chromium 70 on Windows 10.



Chromium 70 seems to use the theme-color meta attribute to color the app window frame. For websites which do not specify such an attribute, it seems to default to a (quite ugly) gray, no matter which theme the browser is running in.



For example, the window in the background here specified



<meta name="theme-color" content="#000000">


in the head while the foreground window has no such attribute:



app window frames



I wanted to use a Tampermonkey script to add that attribute and recolor the app window frame, but it does not seem to have any effect, despite being added correctly to the head after checking back on it.



// ==UserScript==
// @name Discord App Color
// @namespace http://ray.syroot.com/discord
// @version 0.1
// @description Change the Discord app color.
// @author Ray
// @match https://discordapp.com/*
// @grant none
// ==/UserScript==

(function()
'use strict';

var meta = document.createElement("meta");
meta.name = "theme-color";
meta.content = "#000000";
document.getElementsByTagName("head")[0].appendChild(meta);
)();


Can it be that Chromium is not watching this theme-color meta tag at the right time? I already tried to specify



// @run-at document-start


to add it at the earliest time possible, but the window frame was still gray as seen above.










share|improve this question



















  • 1




    With few exceptions, changing meta tags from javascript will never have an effect. If changing that meta tag works at all, you might be able to do it by replacing the entire document/DOM. I don't have the time to scrounge the links or investigate this more, but a lot of this has been covered before.
    – Brock Adams
    Nov 9 at 20:02










  • @BrockAdams Thanks for the directions. I'm not even sure if that's a good idea for such a big app (like Discord). I may try that though, but this may just not be possible with Tampermonkey at all. Would be fancy if Chromium allowed to somehow check back on the theme color though, in case someone provides a dark or bright theme for his app.
    – Ray Koopa
    Nov 9 at 20:08














up vote
1
down vote

favorite












I'm running a website in a desktop / app window in Chromium 70 on Windows 10.



Chromium 70 seems to use the theme-color meta attribute to color the app window frame. For websites which do not specify such an attribute, it seems to default to a (quite ugly) gray, no matter which theme the browser is running in.



For example, the window in the background here specified



<meta name="theme-color" content="#000000">


in the head while the foreground window has no such attribute:



app window frames



I wanted to use a Tampermonkey script to add that attribute and recolor the app window frame, but it does not seem to have any effect, despite being added correctly to the head after checking back on it.



// ==UserScript==
// @name Discord App Color
// @namespace http://ray.syroot.com/discord
// @version 0.1
// @description Change the Discord app color.
// @author Ray
// @match https://discordapp.com/*
// @grant none
// ==/UserScript==

(function()
'use strict';

var meta = document.createElement("meta");
meta.name = "theme-color";
meta.content = "#000000";
document.getElementsByTagName("head")[0].appendChild(meta);
)();


Can it be that Chromium is not watching this theme-color meta tag at the right time? I already tried to specify



// @run-at document-start


to add it at the earliest time possible, but the window frame was still gray as seen above.










share|improve this question



















  • 1




    With few exceptions, changing meta tags from javascript will never have an effect. If changing that meta tag works at all, you might be able to do it by replacing the entire document/DOM. I don't have the time to scrounge the links or investigate this more, but a lot of this has been covered before.
    – Brock Adams
    Nov 9 at 20:02










  • @BrockAdams Thanks for the directions. I'm not even sure if that's a good idea for such a big app (like Discord). I may try that though, but this may just not be possible with Tampermonkey at all. Would be fancy if Chromium allowed to somehow check back on the theme color though, in case someone provides a dark or bright theme for his app.
    – Ray Koopa
    Nov 9 at 20:08












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I'm running a website in a desktop / app window in Chromium 70 on Windows 10.



Chromium 70 seems to use the theme-color meta attribute to color the app window frame. For websites which do not specify such an attribute, it seems to default to a (quite ugly) gray, no matter which theme the browser is running in.



For example, the window in the background here specified



<meta name="theme-color" content="#000000">


in the head while the foreground window has no such attribute:



app window frames



I wanted to use a Tampermonkey script to add that attribute and recolor the app window frame, but it does not seem to have any effect, despite being added correctly to the head after checking back on it.



// ==UserScript==
// @name Discord App Color
// @namespace http://ray.syroot.com/discord
// @version 0.1
// @description Change the Discord app color.
// @author Ray
// @match https://discordapp.com/*
// @grant none
// ==/UserScript==

(function()
'use strict';

var meta = document.createElement("meta");
meta.name = "theme-color";
meta.content = "#000000";
document.getElementsByTagName("head")[0].appendChild(meta);
)();


Can it be that Chromium is not watching this theme-color meta tag at the right time? I already tried to specify



// @run-at document-start


to add it at the earliest time possible, but the window frame was still gray as seen above.










share|improve this question















I'm running a website in a desktop / app window in Chromium 70 on Windows 10.



Chromium 70 seems to use the theme-color meta attribute to color the app window frame. For websites which do not specify such an attribute, it seems to default to a (quite ugly) gray, no matter which theme the browser is running in.



For example, the window in the background here specified



<meta name="theme-color" content="#000000">


in the head while the foreground window has no such attribute:



app window frames



I wanted to use a Tampermonkey script to add that attribute and recolor the app window frame, but it does not seem to have any effect, despite being added correctly to the head after checking back on it.



// ==UserScript==
// @name Discord App Color
// @namespace http://ray.syroot.com/discord
// @version 0.1
// @description Change the Discord app color.
// @author Ray
// @match https://discordapp.com/*
// @grant none
// ==/UserScript==

(function()
'use strict';

var meta = document.createElement("meta");
meta.name = "theme-color";
meta.content = "#000000";
document.getElementsByTagName("head")[0].appendChild(meta);
)();


Can it be that Chromium is not watching this theme-color meta tag at the right time? I already tried to specify



// @run-at document-start


to add it at the earliest time possible, but the window frame was still gray as seen above.







chromium meta tampermonkey






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 19:56









Brock Adams

67.5k14153211




67.5k14153211










asked Nov 9 at 19:23









Ray Koopa

2,57722657




2,57722657







  • 1




    With few exceptions, changing meta tags from javascript will never have an effect. If changing that meta tag works at all, you might be able to do it by replacing the entire document/DOM. I don't have the time to scrounge the links or investigate this more, but a lot of this has been covered before.
    – Brock Adams
    Nov 9 at 20:02










  • @BrockAdams Thanks for the directions. I'm not even sure if that's a good idea for such a big app (like Discord). I may try that though, but this may just not be possible with Tampermonkey at all. Would be fancy if Chromium allowed to somehow check back on the theme color though, in case someone provides a dark or bright theme for his app.
    – Ray Koopa
    Nov 9 at 20:08












  • 1




    With few exceptions, changing meta tags from javascript will never have an effect. If changing that meta tag works at all, you might be able to do it by replacing the entire document/DOM. I don't have the time to scrounge the links or investigate this more, but a lot of this has been covered before.
    – Brock Adams
    Nov 9 at 20:02










  • @BrockAdams Thanks for the directions. I'm not even sure if that's a good idea for such a big app (like Discord). I may try that though, but this may just not be possible with Tampermonkey at all. Would be fancy if Chromium allowed to somehow check back on the theme color though, in case someone provides a dark or bright theme for his app.
    – Ray Koopa
    Nov 9 at 20:08







1




1




With few exceptions, changing meta tags from javascript will never have an effect. If changing that meta tag works at all, you might be able to do it by replacing the entire document/DOM. I don't have the time to scrounge the links or investigate this more, but a lot of this has been covered before.
– Brock Adams
Nov 9 at 20:02




With few exceptions, changing meta tags from javascript will never have an effect. If changing that meta tag works at all, you might be able to do it by replacing the entire document/DOM. I don't have the time to scrounge the links or investigate this more, but a lot of this has been covered before.
– Brock Adams
Nov 9 at 20:02












@BrockAdams Thanks for the directions. I'm not even sure if that's a good idea for such a big app (like Discord). I may try that though, but this may just not be possible with Tampermonkey at all. Would be fancy if Chromium allowed to somehow check back on the theme color though, in case someone provides a dark or bright theme for his app.
– Ray Koopa
Nov 9 at 20:08




@BrockAdams Thanks for the directions. I'm not even sure if that's a good idea for such a big app (like Discord). I may try that though, but this may just not be possible with Tampermonkey at all. Would be fancy if Chromium allowed to somehow check back on the theme color though, in case someone provides a dark or bright theme for his app.
– Ray Koopa
Nov 9 at 20:08

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232099%2fchange-theme-color-meta-attribute-has-no-effect-in-chromium%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232099%2fchange-theme-color-meta-attribute-has-no-effect-in-chromium%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo