Saturday, April 26, 2014

Notes on Chrome Extension Development


DO-Share plugin

We can import other js libs:

<script src="libs/jquery-1.8.0.min.js"></script>
<script src="libs/jquery-ui-1.8.23.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="jqueryui_css/ui-lightness/jquery-ui-1.8.19.custom.css">

jsapi_for_google_plus.js
From EverNote Clearly

chrome.app.runtime.onLaunched.addListener(function() {
  chrome.app.window.create('main.html', {"id": "analyticsWinID"}, function() {});
});

chrome.tabs.query({ 'windowId': chrome.windows.WINDOW_ID_CURRENT, 'active': true }, function (_selected_tabs)
if (_selected_tab.incognito) { return; }
chrome.tabs.update(_selected_tab.id, {'url': 'chrome-extension://iooicodkiihhpojmmeghjclgihfjdjhj/blank.html'});
chrome.tabs.sendMessage(_selected_tab.id, { '_type': 'inject' });

chrome.app.runtime.onLaunched.addListener(function () {
  chrome.app.window.create("window.html", {
    id: "mainwin",
    bounds: {width:600, height:400}
  });
});

No comments:

Post a Comment