Вот js расширения chrome (я не смог добавить весь js, потому что он слишком длинный).
Он загружает тело сайта (текст) и заголовок и открывает его в новой вкладке.Где я должен измениться?и расширение может загрузить текст, который я выбрал.Заголовки не проблема.
var API = "https://www.lingq.com/api/v2/";
chrome.tabs.query({active: true, currentWindow: true}, function(tabs){
var articleURL = tabs[0].url,
articleTitle = tabs[0].title;
$('.title').text(articleTitle);
/* Disable internal links */
$('a').attr('target', '_blank').on('click', function(){
window.setTimeout(function(){window.close()}, 200);
});
/* Identify user */
$.getJSON(API + 'profiles/', function(data){
chrome.cookies.get({url: API, name: 'csrftoken'}, function(cookie){
var profile = data.results[0],
languages = $('select[name=language]'),
courses = $('select[name=course]'),
tags = $('select[name=tags]').select2({
placeholder: "Add tag",
tags: true,
ajax: {
url: API + 'lesson-tags/',
dataType: 'json',
delay: 250,
data: function (params) {
return {
q: params.term,
page: params.page,
page_size: 10,
};
},
processResults: function (data, params) {
var items = [];
$.map(data.results, function(item){ items.push({id: item.title, text: item.title}) });
return {
results: items,
pagination: {more: data.next != null}
};
},
cache: