How would Chrome handle this scenario.
Suppose I have two extensions installed. One extension that turns the page blue and the other one that turns the page red. Which extension gets priority?
How would Chrome handle this scenario.
Suppose I have two extensions installed. One extension that turns the page blue and the other one that turns the page red. Which extension gets priority?
Share Improve this question edited Apr 3, 2012 at 7:37 Chamilyan asked Apr 3, 2012 at 5:57 ChamilyanChamilyan 9,43310 gold badges39 silver badges68 bronze badges 5- 1 You could just try it, you know. – Some Guy Commented Apr 3, 2012 at 7:39
- @Amaan yeah I know. But I thought this would be useful for people searching. I'll try it in a few minutes. But feel free to answer if you get there before me :) – Chamilyan Commented Apr 3, 2012 at 8:33
- 1 hmm, appears to run both with the first extension in the chrome://settings/extensions list getting priority. – Chamilyan Commented Apr 3, 2012 at 10:15
- @Chamilyan That is wrong: The order of display is not relevant. I've created two demo extensions to verify my statements (source code here: pastebin./hUNkG8TM). Just toggle between them. – Rob W Commented Apr 3, 2012 at 20:00
- @RobW good stuff. Thanks for expressing all the different factors. – Chamilyan Commented Apr 3, 2012 at 21:01
2 Answers
Reset to default 8The final behaviour depends on the following factors:
Specifity of the CSS selectors. Example:
html body
is more specific thanbody
.Shorthand properties:
background-color:red;
always overridesbackground:cyan;
.The existence of the
!important
flag:!important
declarations can only be overridden by another!important
declaration.Order of execution: Extensions which are installed more recently are executed last.
This means that the extension which was (re)loaded in the end will "win", provided that the previous decision rules were undecided.
Both extensions will execute. The one that executes first will turn the page to one color, the second to other color. Last color prevails.
The sequence of execution depends on many things, for example, if both extensions are listening to the same event, the sequence depends on which added its listener first.