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:
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
add a comment |
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:
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
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
add a comment |
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:
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
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:
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
chromium meta tampermonkey
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
add a comment |
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
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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