Friday, February 1, 2013

Good Color


backgroundrgb(43, 132, 132);

Tuesday, January 29, 2013

Some Handy Code

Good Code for A Link

<span style="font: 18px sans-serif; display: block; margin: 100px 0 0 150px;"><a style="color:#06F;" >Some Text</a> (Some more text)</span>

Thursday, January 24, 2013

input type=range customization

http://jsfiddle.net/_Sud/cEy9n/


css


input[type=range] {
    -webkit-appearance: none;
    background-color: silver;
    width: 200px;
    height:10px;
    border-radius:50px;
}

input[type="range"]::-webkit-slider-thumb {
     -webkit-appearance: none;/*
    background-color: #666;
    opacity: 0.5;
    width: 10px;
    height: 26px;*/
    width:15px;
height:15px;
border-radius:50px;
color:#fff;
box-shadow:1px 1px 2px #000;
background:#cccbbb;
opacity:0.95;
}
input[type="range"]::-webkit-slider-thumb:hover{
color:#aaa;
opacity:1;
-webkit-transform: scale(1.2,1.2);
}

HTML

<input type="range" min="0" max="100">

Code to place a content relative to size


<!doctype html>
<html>
<head>
<style>
#root{
width:30px;
height:30px;
display:-webkit-box;
-webkit-box-orient:horizontal;
-webkit-box-pack:center;
-webkit-box-align:center;
}
#handler{
display:block;
width:15px;
height:15px;
border-radius:50px;
color:#fff;
box-shadow:1px 1px 2px #000;
background:#cccbbb;
opacity:0.95;
}
#handler:hover{
color:#eee;
opacity:1;
-webkit-transform: scale(1.2,1.2);
}
body{
padding:0px;
margin:0px;
}
</style>
<script>
function triggerState(){
console.log("Clicked");
}
</script>
</head>
<body>
<div id="root">
<div id="handler" onclick="javascript:triggerState()">
</div>
</div>
</body>
</html>

This code places div relative to size of parent and positions in center

Wednesday, January 23, 2013

Safari Extensions

safari.extension.bars returns all bar window objects for a Safari Window.
safari.extension.baseURI returns the id of safari extension per session


safari.application.activeBrowserWindow returns the reference to active window


The user can hide the extension bar using the View menu, but the extension bar page still loads every time a window is opened and any JavaScript still executes—only the display is suppressed by the View menu.

openTab() will open a new Tab

openBrowserWindow() will open a new Window.

Tuesday, January 22, 2013

Download .CRX Code


https://clients2.google.com/service/update2/crx?response=redirect&x=id%3D<EXTENSIONID>%26uc

Friday, January 18, 2013

Google subdomain access in content scripts

The reason is that this opens you up to being injected where you don't expect, which can lead to security problems.  In your above code, it would run onhttp://google.phisher.org for example.  Even if you changed your code to explicitly test for known registry-controlled domains (.com, .co.uk, .jp, etc.), you'd still have a problem in that most companies (including Google) don't actually own companyname.* for every RCD that's out there.  Further, in the cases where the company doesn't own that domain, the domain is often being used for phishing/malware, etc.  So the only way to do this is to know ahead of time the explicit list of RCDs that are controlled by the company, which can be a pain to figure out unfortunately.

it is the reason you can not do *://*.google.*/ in match pattern