div::after{
border-radius: 100% 0 0 0;
}
var menu_obj = {
'title': "Save Image in Folder...",
'contexts': ["image"],
'onclick': (function() { return false; })
};
var parent_id = chrome.contextMenus.create(menu_obj);
var folders = JSON.parse(localStorage.getItem("folders"));
var items = {};
for (var i = 0; i < Object.keys(folders).length; i++) {
var child_obj = {
'title': folders[i],
'contexts': ["all"],
'onclick': (function(info,tab) {
var url = info['srcUrl'];
var dir = items[info['menuItemId']];
var filename = dir+url.substring(url.lastIndexOf('/')+1);
chrome.downloads.download({url:url,filename:filename,saveAs: false},function() {
console.log(chrome.runtime.lastError);
});
}),
'parentId': parent_id
};
var id = chrome.contextMenus.create(child_obj);
items[id] = folders[i];
}
Examples
You can find simple examples of using the chrome.downloads API in the examples/api/downloads directory. For other examples and for help in viewing the source code, see Samples.
let array = [1, 2, 3, 4, 5 .... n]
console.log(array[0]) // вывод в консоле 1
console.log(array[1]) // вывод в консоле 2
console.log(array[2]) // вывод в консоле 3
<ul>
<li></li> <!-- li[0] -->
<li></li> <!-- li[1] -->
<li></li> <!-- li[2] -->
<li></li> <!-- li[3] -->
<li></li> <!-- li[4] -->
</ul>
# запретить всё, что не разрешено для входящих
iptables -P INPUT DROP
# разрешить подключаться с IP-адреса 1.2.3.4 по протоколу TCP на порт 20
iptables -A INPUT -s 1.2.3.4 -p tcp --dport 20 -j ACCEPT
# разрешить подключаться с IP-адреса 1.2.3.4 по протоколу TCP на порт 80
iptables -A INPUT -s 1.2.3.4 -p tcp --dport 80 -j ACCEPT
# посмотреть таблицу установленных правил
iptables -nL
<nav>
<a>
<a>
<a>
</nav>
Метод filter() создаёт новый массив со всеми элементами, прошедшими проверку, задаваемую в передаваемой функции.
if (!Array.prototype.filter)
Array.prototype.filter = function(func, thisArg) {
'use strict';
if ( ! ((typeof func === 'Function' || typeof func === 'function') && this) )
throw new TypeError();
var len = this.length >>> 0,
res = new Array(len), // preallocate array
t = this, c = 0, i = -1;
if (thisArg === undefined)
while (++i !== len)
// checks to see if the key was set
if (i in this)
if (func(t[i], i, t))
res[c++] = t[i];
else
while (++i !== len)
// checks to see if the key was set
if (i in this)
if (func.call(thisArg, t[i], i, t))
res[c++] = t[i];
res.length = c; // shrink down array to proper size
return res;
};
<label for="foo">
<select name="foo" id="foo" data-role="none">
<option value="a">A</option>
<option value="b">B</option>
<option value="c">C</option>
</select>
#custom-collapsible {
width: 74% !important;
margin-left: 9px !important;
border-width: 0px !important;
background-color: white !important;
}
#custom-collapsible h3 a {
border-width: 0px !important;
background: white !important;
}
var path = s.path(firstPath).attr({"fill-opacity": 0, stroke: "#000"});
<header>
<div class="logo">
<img>
</div>
<div class="navigation">
... link etc
</div>
</header>
ps да еще и криво сделали....