1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 function getStyle(elem
, name
) {
6 if (document
.defaultView
&& document
.defaultView
.getComputedStyle
) {
7 name
= name
.toLowerCase();
10 var s
= document
.defaultView
.getComputedStyle(elem
, '');
11 return s
&& s
.getPropertyValue(name
);
20 var bElement
= document
.getElementById('test2');
21 var display
= getStyle(bElement
, 'display').toLowerCase();
22 var extensionPort
= chrome
.runtime
.connect();
23 extensionPort
.postMessage({message
: display
});