Chrome Extensions

44 views
Skip to first unread message

shabeena nawaz

unread,
Apr 23, 2015, 7:54:31 AM4/23/15
to chromium-...@chromium.org
How  can i capture URL and Browser Resolution in Eventpage,js and POST them to the div items in another htmlfile??

Onno van der Zee

unread,
Apr 26, 2015, 1:22:41 PM4/26/15
to chromium-...@chromium.org

in the content script you could setup a sort of private connection to the background script with chrome.runtime.connect and have to report location.href, document.documentElement.clientWidth and document.documentElement.clientHeight. 
then in the background you setup the other end of the private channel with a chrome.runtime.onConnect.addListener and catch the messaging.
when you catch the message you loop through the tabs with chrome.tabs.query and send every tab the data using chrome.tabs.connect
the broadcasted message can be caught with a chrome.runtime.onConnect.addListener in the content script

enjoy


Op donderdag 23 april 2015 13:54:31 UTC+2 schreef shabeena nawaz:
Reply all
Reply to author
Forward
0 new messages