This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body { | |
width: 300px; | |
} | |
</style> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Email message | |
String toAddress = "[email protected]"; | |
String fromAddress = "[email protected]"; | |
String subject = "Hello Yahoo!" | |
String message = "From Java!"; | |
// Auth. | |
String host = "smtp.mail.yahoo.com"; | |
String port = "465"; | |
String username = "foo"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
const API_KEY = 'SOME_KEY'; | |
/** | |
* Use HTML5 Canvas to get the image data | |
* @param {HTMLImageElement} img An Image Tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<script> | |
chrome.extension.onRequest.addListener(function(request, sender, sendResponse) { | |
var notificationObj = request.NotificationCallback; | |
if (notificationObj) { | |
if (notificationObj.url) { | |
// HTML Notification. | |
} | |
else { | |
// TEXT Notification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
// Fired when a URL is visited, providing the HistoryItem data for that URL. | |
chrome.history.onVisited.addListener(function(historyItem) { | |
// Deletes all items from the history. | |
chrome.history.deleteAll(function() {}); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Content Script to save data. | |
chrome.extension.sendRequest({storage: 'foo', value: 'bar'}); | |
// Content Script to get data. | |
chrome.extension.sendRequest({storage: 'foo'}, function(response) { | |
console.log('foo => ' + response.storage); | |
}); | |
// Background Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doProcess() { | |
// do something; | |
funcA(data, /*callback*/ function () { | |
// do something; | |
funcB(data, /* callback*/ function () { | |
// do something; | |
funcC(data, /* callback*/ function () { | |
// do something; | |
funcD(data, /* callback*/ function () { | |
// do something; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var function_queue = [ | |
funcA, | |
funcB, | |
funcC, | |
funcD | |
]; | |
function doNextAction() { | |
if (function_queue.length) { | |
var next_function_call = function_queue.shift(); | |
next_function_call(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!-- Simple keyboard state handler, Vincent Scheib. --> | |
<!-- Adapted from http://www.cryer.co.uk/resources/javascript/script20_respond_to_keypress.htm --> | |
<html><body> | |
<table border="1" cellspacing="0"> | |
<tbody><tr> | |
<th>KeyDown</th> | |
<th>KeyUp</th> | |
<th>KeyPress</th> | |
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.StringReader; | |
import java.io.StringWriter; | |
import javax.xml.bind.JAXBContext; | |
import javax.xml.bind.JAXBException; | |
import javax.xml.bind.Marshaller; | |
import javax.xml.bind.Unmarshaller; | |
import javax.xml.bind.annotation.XmlAccessType; | |
import javax.xml.bind.annotation.XmlAccessorType; | |
import javax.xml.bind.annotation.XmlElement; |
OlderNewer