mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
28 lines
714 B
JavaScript
28 lines
714 B
JavaScript
/* vim:fileencoding=utf-8
|
|
*
|
|
* Copyright (C) 2022 Kovid Goyal <kovid at kovidgoyal.net>
|
|
*
|
|
* Distributed under terms of the GPLv3 license
|
|
*/
|
|
|
|
|
|
(function() {
|
|
"use strict";
|
|
|
|
function send_msg(data) {
|
|
var token = 'TOKEN';
|
|
var msg = token + ' ' + JSON.stringify(data);
|
|
console.log(msg);
|
|
}
|
|
|
|
function debug() {
|
|
var args = Array.prototype.slice.call(arguments);
|
|
var text = args.join(' ');
|
|
send_msg({type: 'print', text: text});
|
|
}
|
|
|
|
if (!document.location.href.startsWith('chrome-error:') && !document.location.href.startsWith('about:')) {
|
|
send_msg({type: 'domready', html: new XMLSerializer().serializeToString(document)});
|
|
}
|
|
})();
|