Skip to content

Commit

Permalink
Updated content (possibly desctructively) using new version of scraper
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitbot committed Mar 9, 2015
1 parent 2f556d1 commit 15ad956
Show file tree
Hide file tree
Showing 158 changed files with 2,908 additions and 1,710 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

chrome-extensions-example
=========================
chrome-extensions-examples
==========================

The [Chrome Extensions examples](http://developer.chrome.com/extensions/samples.html) did not
The [Chrome Extensions examples](http://developer.chrome.com/extensions/samples) did not
exist as a Git repository, and browsing both the samples page and the VCViewer did not seem particularly
handy. So, I decided to scrape the content into this repository for easier browsing and (possible)
editing.

If you would like to clone a part of this repository, use git
If you would like to clone a part of this repository, use git
[sparse checkouts](http://jasonkarns.com/blog/subdirectory-checkouts-with-git-sparse-checkout/).

You can find the scraper used to generate this repository (except for a `git init` and push)
You can find the scraper used to generate this repository (except for a `git init` and push)
on [github](https://github.com/orbitbot/chrome-extension-scraper).


Expand Down Expand Up @@ -42,21 +42,22 @@ Example projects
* [Chromium IRC App](/app_2/)
* [Chromium Search](/chrome_search/)
* [Console TTS Engine](/console_tts_engine/)
* [Content Script Cross-Domain XMLHttpRequest Example](/contentscript_xhr/)
* [Content settings](/contentSettings/)
* [Context Menus Sample](/basic_2/)
* [Context Menus Sample (with Event Page)](/event_page/)
* [Cookie API Test Extension](/cookies/)
* [Desktop Capture Example](/desktopCapture/)
* [Download Filename Controller](/download_filename_controller/)
* [Download Manager Button](/download_manager/)
* [Download Selected Links](/download_links/)
* [Download and Open Button](/download_open/)
* [Downloads Overwrite Existing Files](/downloads_overwrite/)
* [Email this page (by Google)](/email_this_page/)
* [Event Page Example](/basic_4/)
* [Event Tracking with Google Analytics](/analytics/)
* [Fake Archive Handler App](/archive/)
* [File System Provider API Extension Example](/basic_5/)
* [FirePHP for Chrome](/chrome-firephp/)
* [Getting started example](/getstarted/)
* [Google Calendar Checker (by Google)](/calendar/)
* [Google Document List Viewer](/gdocs/)
* [Google Mail Checker](/gmail/)
Expand All @@ -67,6 +68,7 @@ Example projects
* [Keep Awake](/power/)
* [Keyboard Pin](/pin/)
* [Live HTTP headers](/live-headers/)
* [Managed Bookmarks](/managed_bookmarks/)
* [Mappy](/mappy/)
* [Merge Windows](/merge_windows/)
* [Message Timer](/timer/)
Expand All @@ -80,8 +82,6 @@ Example projects
* [News Reader (by Google)](/news/)
* [Notification Demo](/notifications/)
* [Omnibox Example](/simple-example/)
* [One-click Kittens](/getstarted/)
* [Page Benchmarker](/benchmark/)
* [Page Redder](/make_page_red/)
* [Page action by URL](/pageaction_by_url/)
* [Page action by content](/pageaction_by_content/)
Expand All @@ -92,7 +92,6 @@ Example projects
* [Sample - OAuth Contacts](/oauth_contacts/)
* [Sample Extension Commands extension](/commands/)
* [Sandboxed Frame](/sandbox/)
* [SandwichBar](/sandwichbar/)
* [Show Tabs in Process](/show_tabs/)
* [Simple Background App](/background-simple/)
* [Speak Selection](/speak_selection/)
Expand All @@ -101,12 +100,13 @@ Example projects
* [TTS Demo](/ttsdemo/)
* [Tab Inspector](/inspector/)
* [Tab Shortcuts](/tab_shortcuts/)
* [Tabs Zoom API Demo](/zoom/)
* [Talking Alarm Clock](/talking_alarm_clock/)
* [Test IME](/basic_5/)
* [Test IME](/basic_6/)
* [Test Screenshot Extension](/screenshot/)
* [Top Chrome Extension Questions](/extension-questions/)
* [Top Sites](/basic_6/)
* [Top Sites](/basic_7/)
* [Typed URL History](/showHistory/)
* [WebNavigation Tech Demo](/basic_7/)
* [WebNavigation Tech Demo](/basic_8/)
* [`extension.isAllowedFileSchemeAccess` and `extension.isAllowedIncognitoAccess` Example](/isAllowedAccess/)
* [iGoogle new tab page](/override_igoogle/)
3 changes: 1 addition & 2 deletions allowThirdPartyCookies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ Content is licensed under the [Google BSD License](http://code.google.com/google
Calls
-----

* [extension.isAllowedIncognitoAccess](http://developer.chrome.com/extensions/extension.html#method-isAllowedIncognitoAccess)
* [privacy.websites.thirdPartyCookiesAllowed](http://developer.chrome.com/extensions/privacy.html#property-websites-thirdPartyCookiesAllowed)
* [extension.isAllowedIncognitoAccess](https://developer.chrome.com/extensions/extension#method-isAllowedIncognitoAccess)
3 changes: 1 addition & 2 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ Content is licensed under the [Google BSD License](http://code.google.com/google
Calls
-----

* [runtime.connectNative](http://developer.chrome.com/extensions/runtime.html#method-connectNative)
* [runtime.lastError.message](http://developer.chrome.com/extensions/runtime.html#property-lastError-message)
* [runtime.connectNative](https://developer.chrome.com/extensions/runtime#method-connectNative)
6 changes: 0 additions & 6 deletions app_1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,3 @@ Content is licensed under the [Google BSD License](http://code.google.com/google
Calls
-----

* [app.runtime](http://developer.chrome.com/extensions/app.runtime.html)
* [app.runtime.onLaunched](http://developer.chrome.com/extensions/app.runtime.html#event-onLaunched)
* [app.runtime.onRestarted](http://developer.chrome.com/extensions/app.runtime.html#event-onRestarted)
* [app.window.create](http://developer.chrome.com/extensions/app.window.html#method-create)
* [storage.StorageArea.get](http://developer.chrome.com/extensions/storage.html#method-StorageArea-get)
* [storage.StorageArea.set](http://developer.chrome.com/extensions/storage.html#method-StorageArea-set)
59 changes: 26 additions & 33 deletions app_1/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,29 @@
* found in the LICENSE file.
**/

// Checking for "chrome.app.runtime" availability allows this Chrome app code to
// be tested in a regular web page (like tests/manual.html). Checking for
// "chrome" and "chrome.app" availability further allows this code to be tested
// in non-Chrome browsers, which is useful for example to test touch support
// with a non-Chrome touch device.
// Checking for "chrome" availability allows this app code to be tested in
// non-Chrome browsers, which is useful for example to test touch support with
// a non-Chrome touch device.
// Checking for "chrome.shell" allows testing under app_shell, which does not
// have chrome.app APIs.
// Checking for "chrome.app.runtime" availability allows testing in a regular
// web page (like tests/manual.html).
if (typeof chrome !== 'undefined' && chrome.app && chrome.app.runtime) {
var showCalculatorWindow = function () {
chrome.app.window.create('calculator.html', {
defaultWidth: 243, minWidth: 243, maxWidth: 243,
defaultHeight: 380, minHeight: 380, maxHeight: 380,
innerBounds: {
width: 243, minWidth: 243, maxWidth: 243,
height: 380, minHeight: 380, maxHeight: 380
},
id: 'calculator'
}, function(appWindow) {
appWindow.contentWindow.onload = function() {
new Controller(new Model(9), new View(appWindow.contentWindow));
};

chrome.storage.local.set({windowVisible: true});
appWindow.onClosed.addListener(function() {
chrome.storage.local.set({windowVisible: false});
});
});
}

chrome.app.runtime.onLaunched.addListener(showCalculatorWindow);
chrome.app.runtime.onRestarted.addListener(function() {
chrome.storage.local.get('windowVisible', function(data) {
if (data.windowVisible)
showCalculatorWindow();
});
});
}

function Controller(model, view) {
Expand All @@ -51,21 +44,21 @@ function Controller(model, view) {
/** @private */
Controller.prototype.defineInputs_ = function() {
var inputs = {byButton: {}, byKey: {}};
inputs.byButton['zero'] = inputs.byKey['48'] = '0';
inputs.byButton['one'] = inputs.byKey['49'] = '1';
inputs.byButton['two'] = inputs.byKey['50'] = '2';
inputs.byButton['three'] = inputs.byKey['51'] = '3';
inputs.byButton['four'] = inputs.byKey['52'] = '4';
inputs.byButton['five'] = inputs.byKey['53'] = '5';
inputs.byButton['six'] = inputs.byKey['54'] = '6';
inputs.byButton['seven'] = inputs.byKey['55'] = '7';
inputs.byButton['eight'] = inputs.byKey['56'] = '8';
inputs.byButton['nine'] = inputs.byKey['57'] = '9';
inputs.byButton['point'] = inputs.byKey['190'] = '.';
inputs.byButton['add'] = inputs.byKey['^187'] = '+';
inputs.byButton['subtract'] = inputs.byKey['189'] = '-';
inputs.byButton['multiply'] = inputs.byKey['^56'] = '*';
inputs.byButton['divide'] = inputs.byKey['191'] = '/';
inputs.byButton['zero'] = inputs.byKey['48'] = inputs.byKey['96'] = '0';
inputs.byButton['one'] = inputs.byKey['49'] = inputs.byKey['97'] = '1';
inputs.byButton['two'] = inputs.byKey['50'] = inputs.byKey['98'] = '2';
inputs.byButton['three'] = inputs.byKey['51'] = inputs.byKey['99'] = '3';
inputs.byButton['four'] = inputs.byKey['52'] = inputs.byKey['100'] = '4';
inputs.byButton['five'] = inputs.byKey['53'] = inputs.byKey['101'] = '5';
inputs.byButton['six'] = inputs.byKey['54'] = inputs.byKey['102'] = '6';
inputs.byButton['seven'] = inputs.byKey['55'] = inputs.byKey['103'] = '7';
inputs.byButton['eight'] = inputs.byKey['56'] = inputs.byKey['104'] = '8';
inputs.byButton['nine'] = inputs.byKey['57'] = inputs.byKey['105'] = '9';
inputs.byButton['point'] = inputs.byKey['190'] = inputs.byKey['110'] = '.';
inputs.byButton['add'] = inputs.byKey['^187'] = inputs.byKey['107'] = '+';
inputs.byButton['subtract'] = inputs.byKey['189'] = inputs.byKey['109'] = '-';
inputs.byButton['multiply'] = inputs.byKey['^56'] = inputs.byKey['106'] = '*';
inputs.byButton['divide'] = inputs.byKey['191'] = inputs.byKey['111'] = '/';
inputs.byButton['equals'] = inputs.byKey['187'] = inputs.byKey['13'] = '=';
inputs.byButton['negate'] = inputs.byKey['32'] = '+ / -';
inputs.byButton['clear'] = inputs.byKey['67'] = 'AC';
Expand Down
5 changes: 2 additions & 3 deletions app_1/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
"description": "A simple calculator.",
"manifest_version": 2,
"minimum_chrome_version": "23",
"version": "1.3.2",
"version": "1.3.3",
"app": {"background": {"scripts": ["model.js", "view.js", "controller.js"]}},
"icons": {
"16": "images/icon-16x16.png",
"128": "images/icon-128x128.png"
},
"permissions": ["storage"]
}
}
8 changes: 4 additions & 4 deletions app_launcher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Content is licensed under the [Google BSD License](http://code.google.com/google
Calls
-----

* [extension.getURL](http://developer.chrome.com/extensions/extension.html#method-getURL)
* [management.getAll](http://developer.chrome.com/extensions/management.html#method-getAll)
* [management.launchApp](http://developer.chrome.com/extensions/management.html#method-launchApp)
* [tabs.create](http://developer.chrome.com/extensions/tabs.html#method-create)
* [extension.getURL](https://developer.chrome.com/extensions/extension#method-getURL)
* [management.getAll](https://developer.chrome.com/extensions/management#method-getAll)
* [management.launchApp](https://developer.chrome.com/extensions/management#method-launchApp)
* [tabs.create](https://developer.chrome.com/extensions/tabs#method-create)
25 changes: 25 additions & 0 deletions archive/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Fake Archive Handler App
=======

Demonstrate File System Provider API usage for apps.

[Zipfile](http://developer.chrome.com/extensions/examples/api/fileSystemProvider/archive.zip)

Content is licensed under the [Google BSD License](http://code.google.com/google_bsd_license.html).

Calls
-----

* [fileSystemProvider.mount](https://developer.chrome.com/extensions/fileSystemProvider#method-mount)
* [fileSystemProvider.onCloseFileRequested](https://developer.chrome.com/extensions/fileSystemProvider#event-onCloseFileRequested)
* [fileSystemProvider.onGetMetadataRequested](https://developer.chrome.com/extensions/fileSystemProvider#event-onGetMetadataRequested)
* [fileSystemProvider.onOpenFileRequested](https://developer.chrome.com/extensions/fileSystemProvider#event-onOpenFileRequested)
* [fileSystemProvider.onReadDirectoryRequested](https://developer.chrome.com/extensions/fileSystemProvider#event-onReadDirectoryRequested)
* [fileSystemProvider.onReadFileRequested](https://developer.chrome.com/extensions/fileSystemProvider#event-onReadFileRequested)
* [fileSystemProvider.onUnmountRequested](https://developer.chrome.com/extensions/fileSystemProvider#event-onUnmountRequested)
* [fileSystemProvider.unmount](https://developer.chrome.com/extensions/fileSystemProvider#method-unmount)
* [runtime.onStartup](https://developer.chrome.com/extensions/runtime#event-onStartup)
* [runtime.onSuspend](https://developer.chrome.com/extensions/runtime#event-onSuspend)
* [storage.StorageArea.get](https://developer.chrome.com/extensions/storage#method-StorageArea-get)
* [storage.StorageArea.set](https://developer.chrome.com/extensions/storage#method-StorageArea-set)
Loading

0 comments on commit 15ad956

Please sign in to comment.