first commit
This commit is contained in:
commit
6972f384c4
|
@ -0,0 +1,2 @@
|
|||
node_modules/
|
||||
*.swp
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
mkdir tls
|
||||
openssl req \
|
||||
-x509 \
|
||||
-newkey rsa:4096 \
|
||||
-keyout tls/key.pem \
|
||||
-out tls/cert.pem \
|
||||
-days 365 \
|
||||
-nodes \
|
||||
-subj '/CN=localhost' \
|
|
@ -0,0 +1,130 @@
|
|||
const { ipcMain, app, BrowserWindow } = require("electron")
|
||||
const gemini = require("gemini-server")
|
||||
const fs = require("fs")
|
||||
const url = require("url")
|
||||
const path = require("path")
|
||||
|
||||
const sigils_dir = "sigils"
|
||||
|
||||
const electron_options = {
|
||||
show: false,
|
||||
webPreferences: {
|
||||
sandbox: true,
|
||||
contextIsolation: true,
|
||||
nodeIntegration: false,
|
||||
enableRemoteModule: false,
|
||||
webgl: false,
|
||||
disableDialogs: true,
|
||||
preload: path.join(__dirname, "preload.js"),
|
||||
},
|
||||
}
|
||||
|
||||
const server_options = {
|
||||
cert: fs.readFileSync('tls/cert.pem'),
|
||||
key: fs.readFileSync('tls/key.pem')
|
||||
}
|
||||
|
||||
const server = gemini(server_options)
|
||||
|
||||
|
||||
async function handle_request(request, response) {
|
||||
if (!request.query) {
|
||||
response.data("Please supply a url in the query string.")
|
||||
return
|
||||
}
|
||||
const target_url = request.query
|
||||
const win = new BrowserWindow(electron_options)
|
||||
|
||||
const load_timeout_ms = 2000
|
||||
const exec_timeout_ms = 2000
|
||||
|
||||
async function timeout(timeout_ms, reason = "") {
|
||||
return new Promise((resolve, reject) => {
|
||||
setTimeout(
|
||||
reject,
|
||||
timeout_ms,
|
||||
reason + " timed out after " + timeout_ms + " miliseconds"
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
var error
|
||||
var current_url
|
||||
var page_sigil_name
|
||||
var page_sigil
|
||||
var data = ""
|
||||
var available_sigils = fs.readdirSync(sigils_dir)
|
||||
|
||||
await Promise.race([
|
||||
win.loadURL(target_url)
|
||||
.catch((err) => { // there was an error loading the page
|
||||
if (err.errno !== -3) {
|
||||
error = err.message
|
||||
} }),
|
||||
timeout(load_timeout_ms)
|
||||
]).catch(() => { // loading timed out
|
||||
win.webContents.stop()
|
||||
})
|
||||
|
||||
|
||||
try {
|
||||
current_url = new URL(win.webContents.getURL())
|
||||
} catch (err) {
|
||||
error = err.code
|
||||
response.data(error)
|
||||
win.destroy()
|
||||
return
|
||||
}
|
||||
|
||||
for (let sigil_name of available_sigils) {
|
||||
if (current_url.host === sigil_name) {
|
||||
page_sigil_name = sigil_name
|
||||
break
|
||||
} else if (
|
||||
sigil_name[0] === "*"
|
||||
&& current_url.host.endsWith(sigil_name.replace("*.", ""))
|
||||
){
|
||||
page_sigil_name = sigil_name
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (! page_sigil_name) {
|
||||
page_sigil = fs.readFileSync(sigils_dir + "/default")
|
||||
} else {
|
||||
page_sigil = fs.readFileSync(sigils_dir + "/" + page_sigil_name)
|
||||
}
|
||||
|
||||
ipcMain.on("page-gemtext", (event, arg) => {
|
||||
data += arg
|
||||
})
|
||||
|
||||
await Promise.race([
|
||||
win.webContents.executeJavaScript(page_sigil).catch(
|
||||
(err) => error = err
|
||||
),
|
||||
|
||||
timeout(exec_timeout_ms, "Script execution")
|
||||
]).catch((err) => error = err)
|
||||
|
||||
ipcMain.removeAllListeners()
|
||||
|
||||
win.destroy()
|
||||
|
||||
if (error) {
|
||||
response.data(error)
|
||||
} else {
|
||||
response.data(data, mimeType="text/gemini")
|
||||
}
|
||||
}
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
;
|
||||
})
|
||||
|
||||
app.whenReady().then(() => {
|
||||
server.on("*", handle_request)
|
||||
server.listen(() => {
|
||||
console.log("listening on localhost:1965")
|
||||
})
|
||||
});
|
|
@ -0,0 +1,674 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
|
@ -0,0 +1,773 @@
|
|||
{
|
||||
"name": "hellgate",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@electron/get": {
|
||||
"version": "1.12.4",
|
||||
"resolved": "https://registry.npmjs.org/@electron/get/-/get-1.12.4.tgz",
|
||||
"integrity": "sha512-6nr9DbJPUR9Xujw6zD3y+rS95TyItEVM0NVjt1EehY2vUWfIgPiIPVHxCvaTS0xr2B+DRxovYVKbuOWqC35kjg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "4.3.1",
|
||||
"env-paths": "2.2.1",
|
||||
"fs-extra": "8.1.0",
|
||||
"global-agent": "2.2.0",
|
||||
"global-tunnel-ng": "2.7.1",
|
||||
"got": "9.6.0",
|
||||
"progress": "2.0.3",
|
||||
"semver": "6.3.0",
|
||||
"sumchecker": "3.0.1"
|
||||
}
|
||||
},
|
||||
"@sindresorhus/is": {
|
||||
"version": "0.14.0",
|
||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz",
|
||||
"integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@szmarczak/http-timer": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz",
|
||||
"integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"defer-to-connect": "1.1.3"
|
||||
}
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "14.14.41",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.41.tgz",
|
||||
"integrity": "sha512-dueRKfaJL4RTtSa7bWeTK1M+VH+Gns73oCgzvYfHZywRCoPSd8EkXBL0mZ9unPTveBn+D9phZBaxuzpwjWkW0g==",
|
||||
"dev": true
|
||||
},
|
||||
"boolean": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/boolean/-/boolean-3.0.3.tgz",
|
||||
"integrity": "sha512-EqrTKXQX6Z3A2nRmMEIlAIfjQOgFnVO2nqZGpbcsPnYGWBwpFqzlrozU1dy+S2iqfYDLh26ef4KrgTxu9xQrxA==",
|
||||
"dev": true
|
||||
},
|
||||
"buffer-crc32": {
|
||||
"version": "0.2.13",
|
||||
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
|
||||
"integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=",
|
||||
"dev": true
|
||||
},
|
||||
"buffer-from": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
|
||||
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
|
||||
"dev": true
|
||||
},
|
||||
"cacheable-request": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz",
|
||||
"integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"clone-response": "1.0.2",
|
||||
"get-stream": "5.2.0",
|
||||
"http-cache-semantics": "4.1.0",
|
||||
"keyv": "3.1.0",
|
||||
"lowercase-keys": "2.0.0",
|
||||
"normalize-url": "4.5.0",
|
||||
"responselike": "1.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"get-stream": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
|
||||
"integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"pump": "3.0.0"
|
||||
}
|
||||
},
|
||||
"lowercase-keys": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz",
|
||||
"integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"clone-response": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz",
|
||||
"integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mimic-response": "1.0.1"
|
||||
}
|
||||
},
|
||||
"concat-stream": {
|
||||
"version": "1.6.2",
|
||||
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
|
||||
"integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "1.1.1",
|
||||
"inherits": "2.0.4",
|
||||
"readable-stream": "2.3.7",
|
||||
"typedarray": "0.0.6"
|
||||
}
|
||||
},
|
||||
"config-chain": {
|
||||
"version": "1.1.12",
|
||||
"resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz",
|
||||
"integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ini": "1.3.8",
|
||||
"proto-list": "1.2.4"
|
||||
}
|
||||
},
|
||||
"core-js": {
|
||||
"version": "3.10.2",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.10.2.tgz",
|
||||
"integrity": "sha512-W+2oVYeNghuBr3yTzZFQ5rfmjZtYB/Ubg87R5YOmlGrIb+Uw9f7qjUbhsj+/EkXhcV7eOD3jiM4+sgraX3FZUw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
||||
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
|
||||
"dev": true
|
||||
},
|
||||
"debug": {
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
|
||||
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ms": "2.1.2"
|
||||
}
|
||||
},
|
||||
"decompress-response": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz",
|
||||
"integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mimic-response": "1.0.1"
|
||||
}
|
||||
},
|
||||
"defer-to-connect": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz",
|
||||
"integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==",
|
||||
"dev": true
|
||||
},
|
||||
"define-properties": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
|
||||
"integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"object-keys": "1.1.1"
|
||||
}
|
||||
},
|
||||
"detect-node": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.5.tgz",
|
||||
"integrity": "sha512-qi86tE6hRcFHy8jI1m2VG+LaPUR1LhqDa5G8tVjuUXmOrpuAgqsA1pN0+ldgr3aKUH+QLI9hCY/OcRYisERejw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"duplexer3": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",
|
||||
"integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=",
|
||||
"dev": true
|
||||
},
|
||||
"electron": {
|
||||
"version": "12.0.5",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-12.0.5.tgz",
|
||||
"integrity": "sha512-z0xYB3sPr0qZcDrHUUWqooPKe3yUzBDxQcgQe3f2TLstA84JIFXBoaIJCPh/fJW0+JdF/ZFVeK2SNgLhYtRV+Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@electron/get": "1.12.4",
|
||||
"@types/node": "14.14.41",
|
||||
"extract-zip": "1.7.0"
|
||||
}
|
||||
},
|
||||
"encodeurl": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
|
||||
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"end-of-stream": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
|
||||
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"once": "1.4.0"
|
||||
}
|
||||
},
|
||||
"env-paths": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
|
||||
"integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",
|
||||
"dev": true
|
||||
},
|
||||
"es6-error": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz",
|
||||
"integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"escape-string-regexp": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
|
||||
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"extract-zip": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz",
|
||||
"integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"concat-stream": "1.6.2",
|
||||
"debug": "2.6.9",
|
||||
"mkdirp": "0.5.5",
|
||||
"yauzl": "2.10.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"fd-slicer": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
|
||||
"integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"pend": "1.2.0"
|
||||
}
|
||||
},
|
||||
"fs-extra": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
|
||||
"integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "4.2.6",
|
||||
"jsonfile": "4.0.0",
|
||||
"universalify": "0.1.2"
|
||||
}
|
||||
},
|
||||
"gemini-server": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/gemini-server/-/gemini-server-1.2.0.tgz",
|
||||
"integrity": "sha512-yfsh4CoG+irW0ek6GK8VS2kf3hC5fUrp+iIruDwQv0KdEUe3S8pToS3XQ2wKOBDv43h5pBQfFJUzkLez3qRHgQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mime": "2.5.2",
|
||||
"path-to-regexp": "6.2.0",
|
||||
"truncate-utf8-bytes": "1.0.2"
|
||||
}
|
||||
},
|
||||
"get-stream": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
|
||||
"integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"pump": "3.0.0"
|
||||
}
|
||||
},
|
||||
"global-agent": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/global-agent/-/global-agent-2.2.0.tgz",
|
||||
"integrity": "sha512-+20KpaW6DDLqhG7JDiJpD1JvNvb8ts+TNl7BPOYcURqCrXqnN1Vf+XVOrkKJAFPqfX+oEhsdzOj1hLWkBTdNJg==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"boolean": "3.0.3",
|
||||
"core-js": "3.10.2",
|
||||
"es6-error": "4.1.1",
|
||||
"matcher": "3.0.0",
|
||||
"roarr": "2.15.4",
|
||||
"semver": "7.3.5",
|
||||
"serialize-error": "7.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "7.3.5",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
|
||||
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"lru-cache": "6.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"global-tunnel-ng": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/global-tunnel-ng/-/global-tunnel-ng-2.7.1.tgz",
|
||||
"integrity": "sha512-4s+DyciWBV0eK148wqXxcmVAbFVPqtc3sEtUE/GTQfuU80rySLcMhUmHKSHI7/LDj8q0gDYI1lIhRRB7ieRAqg==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"encodeurl": "1.0.2",
|
||||
"lodash": "4.17.21",
|
||||
"npm-conf": "1.1.3",
|
||||
"tunnel": "0.0.6"
|
||||
}
|
||||
},
|
||||
"globalthis": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.2.tgz",
|
||||
"integrity": "sha512-ZQnSFO1la8P7auIOQECnm0sSuoMeaSq0EEdXMBFF2QJO4uNcwbyhSgG3MruWNbFTqCLmxVwGOl7LZ9kASvHdeQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"define-properties": "1.1.3"
|
||||
}
|
||||
},
|
||||
"got": {
|
||||
"version": "9.6.0",
|
||||
"resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz",
|
||||
"integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@sindresorhus/is": "0.14.0",
|
||||
"@szmarczak/http-timer": "1.1.2",
|
||||
"cacheable-request": "6.1.0",
|
||||
"decompress-response": "3.3.0",
|
||||
"duplexer3": "0.1.4",
|
||||
"get-stream": "4.1.0",
|
||||
"lowercase-keys": "1.0.1",
|
||||
"mimic-response": "1.0.1",
|
||||
"p-cancelable": "1.1.0",
|
||||
"to-readable-stream": "1.0.0",
|
||||
"url-parse-lax": "3.0.0"
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.2.6",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz",
|
||||
"integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==",
|
||||
"dev": true
|
||||
},
|
||||
"http-cache-semantics": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz",
|
||||
"integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==",
|
||||
"dev": true
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"dev": true
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.8",
|
||||
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
|
||||
"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"isarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
|
||||
"dev": true
|
||||
},
|
||||
"json-buffer": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz",
|
||||
"integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=",
|
||||
"dev": true
|
||||
},
|
||||
"json-stringify-safe": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
|
||||
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"jsonfile": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
|
||||
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "4.2.6"
|
||||
}
|
||||
},
|
||||
"keyv": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz",
|
||||
"integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"json-buffer": "3.0.0"
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"lowercase-keys": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz",
|
||||
"integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==",
|
||||
"dev": true
|
||||
},
|
||||
"lru-cache": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"yallist": "4.0.0"
|
||||
}
|
||||
},
|
||||
"matcher": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz",
|
||||
"integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"escape-string-regexp": "4.0.0"
|
||||
}
|
||||
},
|
||||
"mime": {
|
||||
"version": "2.5.2",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz",
|
||||
"integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==",
|
||||
"dev": true
|
||||
},
|
||||
"mimic-response": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
|
||||
"integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==",
|
||||
"dev": true
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
|
||||
"dev": true
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.5",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
|
||||
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "1.2.5"
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||
"dev": true
|
||||
},
|
||||
"normalize-url": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz",
|
||||
"integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==",
|
||||
"dev": true
|
||||
},
|
||||
"npm-conf": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/npm-conf/-/npm-conf-1.1.3.tgz",
|
||||
"integrity": "sha512-Yic4bZHJOt9RCFbRP3GgpqhScOY4HH3V2P8yBj6CeYq118Qr+BLXqT2JvpJ00mryLESpgOxf5XlFv4ZjXxLScw==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"config-chain": "1.1.12",
|
||||
"pify": "3.0.0"
|
||||
}
|
||||
},
|
||||
"object-keys": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
|
||||
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"wrappy": "1.0.2"
|
||||
}
|
||||
},
|
||||
"p-cancelable": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz",
|
||||
"integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==",
|
||||
"dev": true
|
||||
},
|
||||
"path-to-regexp": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.0.tgz",
|
||||
"integrity": "sha512-f66KywYG6+43afgE/8j/GoiNyygk/bnoCbps++3ErRKsIYkGGupyv07R2Ok5m9i67Iqc+T2g1eAUGUPzWhYTyg==",
|
||||
"dev": true
|
||||
},
|
||||
"pend": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
|
||||
"integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=",
|
||||
"dev": true
|
||||
},
|
||||
"pify": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
|
||||
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"prepend-http": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz",
|
||||
"integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=",
|
||||
"dev": true
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
|
||||
"dev": true
|
||||
},
|
||||
"progress": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
||||
"integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
|
||||
"dev": true
|
||||
},
|
||||
"proto-list": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz",
|
||||
"integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"pump": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
|
||||
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"end-of-stream": "1.4.4",
|
||||
"once": "1.4.0"
|
||||
}
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "2.3.7",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
|
||||
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"core-util-is": "1.0.2",
|
||||
"inherits": "2.0.4",
|
||||
"isarray": "1.0.0",
|
||||
"process-nextick-args": "2.0.1",
|
||||
"safe-buffer": "5.1.2",
|
||||
"string_decoder": "1.1.1",
|
||||
"util-deprecate": "1.0.2"
|
||||
}
|
||||
},
|
||||
"responselike": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz",
|
||||
"integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lowercase-keys": "1.0.1"
|
||||
}
|
||||
},
|
||||
"roarr": {
|
||||
"version": "2.15.4",
|
||||
"resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz",
|
||||
"integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"boolean": "3.0.3",
|
||||
"detect-node": "2.0.5",
|
||||
"globalthis": "1.0.2",
|
||||
"json-stringify-safe": "5.0.1",
|
||||
"semver-compare": "1.0.0",
|
||||
"sprintf-js": "1.1.2"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"dev": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"dev": true
|
||||
},
|
||||
"semver-compare": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz",
|
||||
"integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"serialize-error": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz",
|
||||
"integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"type-fest": "0.13.1"
|
||||
}
|
||||
},
|
||||
"sprintf-js": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz",
|
||||
"integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "5.1.2"
|
||||
}
|
||||
},
|
||||
"sumchecker": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-3.0.1.tgz",
|
||||
"integrity": "sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "4.3.1"
|
||||
}
|
||||
},
|
||||
"to-readable-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz",
|
||||
"integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==",
|
||||
"dev": true
|
||||
},
|
||||
"truncate-utf8-bytes": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz",
|
||||
"integrity": "sha1-QFkjkJWS1W94pYGENLC3hInKXys=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"utf8-byte-length": "1.0.4"
|
||||
}
|
||||
},
|
||||
"tunnel": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
|
||||
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"type-fest": {
|
||||
"version": "0.13.1",
|
||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz",
|
||||
"integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"typedarray": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
|
||||
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
|
||||
"dev": true
|
||||
},
|
||||
"universalify": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
|
||||
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
|
||||
"dev": true
|
||||
},
|
||||
"url-parse-lax": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz",
|
||||
"integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"prepend-http": "2.0.0"
|
||||
}
|
||||
},
|
||||
"utf8-byte-length": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz",
|
||||
"integrity": "sha1-9F8VDExm7uloGGUFq5P8u4rWv2E=",
|
||||
"dev": true
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
|
||||
"dev": true
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||
"dev": true
|
||||
},
|
||||
"yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"yauzl": {
|
||||
"version": "2.10.0",
|
||||
"resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
|
||||
"integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-crc32": "0.2.13",
|
||||
"fd-slicer": "1.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "hellgate",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "hellgate.js",
|
||||
"scripts": {
|
||||
"start": "electron ."
|
||||
},
|
||||
"keywords": [
|
||||
"hell",
|
||||
"gate",
|
||||
"hellgate"
|
||||
],
|
||||
"author": "sose",
|
||||
"license": "GPL3",
|
||||
"devDependencies": {
|
||||
"electron": "^12.0.5",
|
||||
"gemini-server": "^1.2.0"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
const { contextBridge, ipcRenderer } = require("electron")
|
||||
|
||||
window.stop()
|
||||
|
||||
function md_parse(selector) {
|
||||
var data = ""
|
||||
var readme_elements = document.querySelector(selector).children
|
||||
for (let i = 0; i < readme_elements.length; i++) {
|
||||
let element = readme_elements[i]
|
||||
|
||||
let tag_name = element.tagName
|
||||
if (tag_name.startsWith("H") && tag_name.length === 2) {
|
||||
let header_lvl = tag_name[1]
|
||||
data += "\n" + "#".repeat(header_lvl) + " " + element.innerText
|
||||
} else if (tag_name === "P") {
|
||||
data += element.innerText
|
||||
} else if (tag_name === "UL") {
|
||||
let list_items = element.children
|
||||
for (let j = 0; j < list_items.length ; j++) {
|
||||
list_item = list_items[j]
|
||||
data += "\n* " + list_item.innerText.replaceAll("\n", "\n\t - ")
|
||||
}
|
||||
} else if (tag_name === "PRE") {
|
||||
data += "```\n" + element.innerText + "\n```\n"
|
||||
} else {
|
||||
data += "```\n" + element.innerText + "\n```\n"
|
||||
}
|
||||
data += "\n"
|
||||
}
|
||||
return data
|
||||
}
|
||||
function escape_gemtext(string) {
|
||||
return string.replaceAll(/\n\*/g, "\n *")
|
||||
.replaceAll(/\n>/g, "\n >")
|
||||
.replaceAll(/\n#/g, "\n #")
|
||||
.replaceAll(/^```/g, " ```")
|
||||
.replaceAll(/\n```/g, "\n ```")
|
||||
}
|
||||
|
||||
function abs_href(href) {
|
||||
var current_site = window.location.protocol + "//" + window.location.hostname
|
||||
if (href.indexOf("http://") === 0 || href.indexOf("https://") === 0) {
|
||||
return "?" + href
|
||||
} else if (href.indexOf("gemini://") === 0) {
|
||||
return href
|
||||
} else if (href.startsWith("/")) {
|
||||
return "?" + current_site + href
|
||||
} else {
|
||||
return "?" + window.location.href + href
|
||||
}
|
||||
}
|
||||
|
||||
function simple_convert() {
|
||||
var title = window.document.title
|
||||
var link_elements = document.getElementsByTagName("a")
|
||||
var pre_elements = document.getElementsByTagName("pre")
|
||||
var gemtext
|
||||
if (title) { title = "# " + title + "\n\n" }
|
||||
for (let link_element of link_elements) {
|
||||
let href = link_element.getAttribute("href")
|
||||
if (href === null) { continue }
|
||||
link_element.innerText = "\n=> " + abs_href(href) + " " + link_element.innerText + "\n"
|
||||
}
|
||||
gemtext = escape_gemtext(document.getRootNode().children[0].innerText)
|
||||
return title + gemtext
|
||||
}
|
||||
|
||||
contextBridge.exposeInMainWorld(
|
||||
"electron",
|
||||
{
|
||||
send_gemtext: (gemtext) => {
|
||||
ipcRenderer.send("page-gemtext", gemtext)
|
||||
},
|
||||
request_sigil: (sigil_name) => {
|
||||
return ipcRenderer.invoke("request-sigil", sigil_name)
|
||||
},
|
||||
default_sigil: simple_convert,
|
||||
escape_gemtext: escape_gemtext,
|
||||
abs_href: abs_href,
|
||||
md_parse: md_parse,
|
||||
}
|
||||
)
|
|
@ -0,0 +1,50 @@
|
|||
# hellgate
|
||||
[!hellgate logo](mandatory-js-project-logo.png)
|
||||
a complete web-to-gemini proxy
|
||||
|
||||
## requirements
|
||||
- nodejs
|
||||
- npm
|
||||
- electron
|
||||
- openssh
|
||||
- sh
|
||||
- libgtk-2-0
|
||||
- libgconf-2-4
|
||||
- xvfb (if you're running it headless)
|
||||
|
||||
## setup
|
||||
- `sudo apt install libgtk2.0-0 libgconf-2-4` (if you're on debian, other
|
||||
distros idk)
|
||||
- `sudo apt install xvfb` (again, on debian)
|
||||
- `git clone https://tildegit.org/sose/hellgate`
|
||||
- `cd hellgate`
|
||||
- `sudo npm install -g electron --unsafe-perm=true`
|
||||
- `npm install`
|
||||
- `./gen_cert`
|
||||
- `npm start` or `xvfb-run npm start`
|
||||
- the server will listen on localhost:1965
|
||||
- this is not configurable
|
||||
|
||||
## what is this?
|
||||
- hellgate is a web browser with a gemini server attached
|
||||
- ask the server for a webpage and it will access it, render it, and send it to
|
||||
you in gemtext format
|
||||
|
||||
## why not just use `curl` and convert the html to gemtext?
|
||||
- because hellgate runs a fully featured web browser, it has the ability to
|
||||
execute javascript like a browser would
|
||||
- this means websites that require javascript to function (like say, cnn.com)
|
||||
can be made accessible over gemini
|
||||
|
||||
## what is the `sigils` dir for?
|
||||
- hellgate is extensible through the use of files called 'sigils'
|
||||
- a sigil is a file containing user-created javascript that will execute inside
|
||||
the browser sandbox whenever its corresponding page is accessed
|
||||
- sigils are mainly used for generating nicer looking gemtext for specific
|
||||
websites, but they can be used to automate any action within the browser's
|
||||
javascript environment
|
||||
- sigils are located in the `sigils` dir and are titled with the domain name of
|
||||
their corresponding website
|
||||
- see [writing sigils](writing_sigils.md) for more info on how to write a sigil
|
||||
- if you write a new sigil for a specific website, don't hesitate to send it as
|
||||
a pull request to this repo
|
|
@ -0,0 +1,104 @@
|
|||
var data = ""
|
||||
header = document.querySelector("h2")
|
||||
if (header) {
|
||||
data += "# " + header.innerText + "\n\n"
|
||||
|
||||
var nav_links = document.querySelectorAll("li.nav-item > a.nav-link")
|
||||
if (nav_links) {
|
||||
var valid_links = ["summary", "tree", "source"]
|
||||
nav_links.forEach((nav_link) => {
|
||||
if (valid_links.includes(nav_link.innerText)){
|
||||
let href = nav_link.getAttribute("href")
|
||||
if (href[0] === "/") {
|
||||
data += "=> "
|
||||
+ window.electron.abs_href(href)
|
||||
+ " "
|
||||
+ nav_link.innerText
|
||||
+ "\n"
|
||||
} else {
|
||||
data += "=> ?"
|
||||
+ href
|
||||
+ " "
|
||||
+ nav_link.innerText
|
||||
+ "\n"
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
var code_view = document.querySelector("div.col-md-12.code-view > div.highlight > pre")
|
||||
if (code_view) {
|
||||
var header = document.querySelector("div.header-extension").innerText.split(" ")[0]
|
||||
data += "\n## " + header + "\n\n```\n" + code_view.innerText + "```\n"
|
||||
}
|
||||
|
||||
var tree_list = document.querySelector("div.tree-list")
|
||||
if (tree_list) {
|
||||
var header = document.querySelector("div.header-extension").innerText.split(" ")[0]
|
||||
data += "\n## " + header + "\n\n"
|
||||
var tree_items = tree_list.children
|
||||
for (let tree_item of tree_items) {
|
||||
if (tree_item.className.includes("name")) {
|
||||
let item_link = tree_item.querySelector("a").getAttribute("href")
|
||||
data += "=> " + window.electron.abs_href(item_link) + " " + tree_item.innerText + " "
|
||||
} else if (tree_item.className.includes("size")) {
|
||||
if (tree_item.innerText !== "") {
|
||||
data += "(" + tree_item.innerText + ")" + "\n"
|
||||
} else {
|
||||
data += "\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var latest_events = document.querySelectorAll("div.event-list > div.event")
|
||||
if (latest_events.length !== 0) {
|
||||
data += "\n## Latest events:\n\n----\n"
|
||||
latest_events.forEach((event_el) => {
|
||||
data += event_el.innerText + "\n----\n"
|
||||
})
|
||||
}
|
||||
var clone_links = document.querySelector("div.col-md-8 > dl")
|
||||
if (clone_links) {
|
||||
data += "\n## Clone:\n"
|
||||
data += clone_links.innerText + "\n"
|
||||
}
|
||||
var readme_node = document.querySelector("div#readme")
|
||||
var readme_selector = "div#readme"
|
||||
if (! readme_node) { readme_node = document.querySelector("div.readme") } // don't ask me ask drew
|
||||
|
||||
if (readme_node) {
|
||||
var markdown_node = readme_node.querySelector("div.markdown")
|
||||
data += "\n----------\n"
|
||||
if (markdown_node) {
|
||||
var readme_elements = markdown_node.children
|
||||
for (let i = 0; i < readme_elements.length; i++) {
|
||||
let element = readme_elements[i]
|
||||
|
||||
let tag_name = element.tagName
|
||||
if (tag_name.startsWith("H") && tag_name.length === 2) {
|
||||
let header_lvl = tag_name[1]
|
||||
data += "\n"
|
||||
+ "#".repeat(header_lvl)
|
||||
+ " "
|
||||
+ element.innerText.replace("\n", "").replaceAll("#", "")
|
||||
} else if (tag_name === "P") {
|
||||
data += element.innerText
|
||||
} else if (tag_name === "UL") {
|
||||
let list_items = element.children
|
||||
for (let j = 0; j < list_items.length ; j++) {
|
||||
list_item = list_items[j]
|
||||
data += "\n* " + list_item.innerText.replaceAll("\n", "\n\t - ")
|
||||
}
|
||||
} else if (tag_name === "PRE") {
|
||||
data += "```\n" + element.innerText + "```\n"
|
||||
}
|
||||
data += "\n"
|
||||
}
|
||||
} else {
|
||||
data += readme_node.innerText + "\n"
|
||||
}
|
||||
}
|
||||
window.electron.send_gemtext(data)
|
||||
} else {
|
||||
window.electron.send_gemtext(window.electron.default_sigil())
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
window.electron.send_gemtext(window.electron.default_sigil())
|
|
@ -0,0 +1,74 @@
|
|||
async function gen_gemtext() {
|
||||
var data = ""
|
||||
// wait for the page to actually finish loading
|
||||
// ideally we would use a mutation observer here but i am lazy
|
||||
await new Promise((resolve,reject) => {
|
||||
setTimeout(resolve, 900)
|
||||
});
|
||||
if (document.querySelector("span[itemprop='author']") === null) {
|
||||
window.electron.send_gemtext(window.electron.default_sigil())
|
||||
return
|
||||
} else {
|
||||
var title = document.querySelector("span[itemprop='author']").innerText
|
||||
+ " / "
|
||||
+ document.querySelector("strong[itemprop='name']").innerText
|
||||
data += "# " + title + "\n"
|
||||
|
||||
var latest_commit = document.querySelector("div.Box-header")
|
||||
if (latest_commit !== null) {
|
||||
latest_commit = latest_commit.innerText.replaceAll("\n", " ").replace(/History$/, "")
|
||||
data += "\n" + latest_commit + "\n"
|
||||
}
|
||||
var file_list = document.querySelector("div.repository-content")
|
||||
if (file_list !== null) {
|
||||
var file_elements = file_list.querySelectorAll("div.Box-row")
|
||||
if (file_elements.length !== 0) {
|
||||
data += "\n## Files\n\n"
|
||||
for (let i = 0; i < file_elements.length; i++) {
|
||||
let file_element = file_elements[i]
|
||||
if (file_element.innerText == ". .") { continue }
|
||||
let link_el = file_element.querySelector("a.js-navigation-open.Link--primary")
|
||||
let file_title = link_el.innerText
|
||||
let file_link = link_el.getAttribute("href")
|
||||
let last_updated = file_element.querySelector("div.color-text-tertiary.text-right").innerText
|
||||
data += "=> "
|
||||
+ window.electron.abs_href(file_link)
|
||||
+ " "
|
||||
+ file_title
|
||||
+ "\n"
|
||||
+ "* " + "Last updated " + last_updated.trim() + "\n"
|
||||
}
|
||||
} else {
|
||||
var code_lines = document.querySelectorAll("td.blob-num[data-line-number]")
|
||||
var num_lines = code_lines.length
|
||||
var file_name = document.querySelector("strong.final-path")
|
||||
var raw_link = document.querySelector("a#raw-url")
|
||||
if (file_name) {
|
||||
data += "\n## " + file_name.innerText + "\n\n"
|
||||
}
|
||||
if (num_lines !== 0) {
|
||||
data += "```\n"
|
||||
code_lines.forEach((line) => {
|
||||
let line_num = line.getAttribute("data-line-number")
|
||||
let padding = String(num_lines).length - String(line_num).length
|
||||
let line_contents = line.nextElementSibling.innerText.replace(/^\n$/, "")
|
||||
data += line_num + " ".repeat(padding) +"| " + line_contents + "\n"
|
||||
})
|
||||
data += "```\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
var readme_box = document.querySelector("div#readme")
|
||||
if (readme_box) {
|
||||
data += "\n----------\n"
|
||||
var md_contents = document.querySelector("article.markdown-body.entry-content[itemprop='text']")
|
||||
if (md_contents) {
|
||||
data += window.electron.md_parse("article.markdown-body.entry-content[itemprop='text']")
|
||||
} else {
|
||||
data += readme_box.innerText
|
||||
}
|
||||
}
|
||||
}
|
||||
window.electron.send_gemtext(data)
|
||||
}
|
||||
gen_gemtext()
|
|
@ -0,0 +1,76 @@
|
|||
async function gen_gemtext() {
|
||||
// wait for the page to actually finish loading
|
||||
// ideally we would use a mutation observer here but i am lazy
|
||||
await new Promise((resolve,reject) => {
|
||||
setTimeout(resolve, 900)
|
||||
});
|
||||
|
||||
var data = ""
|
||||
var repo_node = document.getElementById("content-body")
|
||||
if (repo_node !== null
|
||||
&& repo_node.getAttribute("itemtype") === "http://schema.org/SoftwareSourceCode" ) {
|
||||
var repo_title = repo_node
|
||||
.querySelector("h1[data-qa-selector='project_name_content']")
|
||||
|
||||
if (repo_title !== null) {
|
||||
data += "# " + repo_title.innerText + "\n\n"
|
||||
}
|
||||
|
||||
var project_stats = repo_node.querySelector("nav.project-stats")
|
||||
if (project_stats !== null) {
|
||||
project_stats = project_stats.innerText.replaceAll("\n ", " ").replaceAll("\n", " | ")
|
||||
data += project_stats + "\n"
|
||||
}
|
||||
|
||||
var latest_commit = repo_node.querySelector("div.commit-detail.flex-list")
|
||||
if (latest_commit !== null) {
|
||||
latest_commit = latest_commit.innerText
|
||||
data += "\n## Last updated: \n\n"
|
||||
data += latest_commit + "\n"
|
||||
}
|
||||
|
||||
file_node_list = repo_node.querySelectorAll("tr.tree-item")
|
||||
if (file_node_list.length !== 0) {
|
||||
data += "\n## Files\n\n"
|
||||
for (let file_node of file_node_list) {
|
||||
if (file_node.innerText === "..") { continue }
|
||||
let file_link = file_node.querySelector("a.tree-item-link")
|
||||
if (file_link !== null) {
|
||||
file_link = window.electron.abs_href(file_link.getAttribute("href"))
|
||||
}
|
||||
let file_info = file_node.innerText.replace(/\t.*\t/, "\n* Last updated ")
|
||||
data += "=> " + file_link + " " + file_info + "\n"
|
||||
}
|
||||
}
|
||||
|
||||
var readme_node = repo_node.querySelector("div.blob-viewer > div.file-content.md")
|
||||
var code_node = repo_node.querySelector("div.blob-viewer > div.file-content.code")
|
||||
if (readme_node !== null) {
|
||||
data += "\n----------\n"
|
||||
data += window.electron.md_parse("div.blob-viewer > div.file-content.md")
|
||||
} else if (code_node !== null) {
|
||||
var file_name = document.querySelector("div.file-header-content").innerText
|
||||
var code_lines = code_node.querySelectorAll("span.line")
|
||||
var num_lines = code_lines.length
|
||||
var raw_link = document.querySelector("a[aria-label='Open raw'")
|
||||
if (raw_link) {
|
||||
raw_link = window.electron.abs_href(raw_link.getAttribute("href"))
|
||||
data += "\n=> " + raw_link + " Raw"
|
||||
}
|
||||
if (num_lines !== 0) {
|
||||
data += "\n\n# " + file_name.replace("\n", "").replace("\n", "|") + "\n\n"
|
||||
data += "```\n"
|
||||
for (let i = 0; i < code_lines.length; i++) {
|
||||
let padding = String(num_lines).length - String(i + 1).length
|
||||
let code_line = code_lines[i]
|
||||
data += String(i + 1) + " ".repeat(padding) + "| " + code_line.innerText + "\n"
|
||||
}
|
||||
data += "```\n"
|
||||
}
|
||||
}
|
||||
window.electron.send_gemtext(data)
|
||||
} else {
|
||||
window.electron.send_gemtext(window.electron.default_sigil())
|
||||
}
|
||||
}
|
||||
gen_gemtext()
|
|
@ -0,0 +1,115 @@
|
|||
var data = ""
|
||||
var repo_nodes = document.getElementsByClassName("page-content repository file list")
|
||||
|
||||
|
||||
if (repo_nodes.length !== 0) {
|
||||
var repo_node = repo_nodes[0]
|
||||
var repo_title = repo_node.getElementsByClassName("repo-title")[0].innerText
|
||||
repo_title = repo_title.replaceAll("\n", " ")
|
||||
repo_title = "# " + repo_title
|
||||
|
||||
data += repo_title + "\n"
|
||||
|
||||
var fork_flag = repo_node.getElementsByClassName("fork-flag")
|
||||
if (fork_flag.length !== 0) {
|
||||
fork_flag = fork_flag[0]
|
||||
.innerText
|
||||
.replaceAll("\n", "")
|
||||
|
||||
data += fork_flag + "\n"
|
||||
}
|
||||
|
||||
var repo_stats = repo_node
|
||||
.getElementsByClassName("ui two horizontal center link list")[0]
|
||||
.innerText
|
||||
.replaceAll("\n", " |")
|
||||
.trim()
|
||||
|
||||
data += "\n" + repo_stats + "\n"
|
||||
|
||||
var latest_commit_info = repo_node
|
||||
.getElementsByClassName("commit-list")
|
||||
if (latest_commit_info.length !== 0) {
|
||||
latest_commit_info = latest_commit_info[0]
|
||||
.innerText
|
||||
.replaceAll("\t", "")
|
||||
.trim()
|
||||
data += "\nLatest commit:\n" + latest_commit_info + "\n"
|
||||
}
|
||||
|
||||
var code_view = document.querySelector("div.file-view.code-view")
|
||||
if (code_view) {
|
||||
var code_lines = code_view.querySelectorAll("td.lines-code")
|
||||
var file_name = document.querySelector("span.ui.breadcrumb.repo-path")
|
||||
var buttons = document.querySelectorAll("a.ui.mini.basic.button")
|
||||
var raw_link
|
||||
buttons.forEach((button) => {
|
||||
if (button.innerText === "Raw") {
|
||||
raw_link = window.electron.abs_href(button.getAttribute("href"))
|
||||
}
|
||||
})
|
||||
if (file_name) { file_name = file_name.innerText }
|
||||
data += "\n## " + file_name + "\n\n"
|
||||
|
||||
if (raw_link) {
|
||||
data += "=> " + raw_link + " Raw\n\n"
|
||||
}
|
||||
var padding
|
||||
data += "```\n"
|
||||
code_lines.forEach((code_line) => {
|
||||
let line_num = code_line.getAttribute("rel").replace(/^./, "")
|
||||
let line_data = code_line.innerText.replace("\n", "")
|
||||
let padding = String(code_lines.length).length - String(line_num.length)
|
||||
data += line_num + " ".repeat(padding) + "| " + line_data + "\n"
|
||||
})
|
||||
data += "\n```\n"
|
||||
}
|
||||
|
||||
var repo_files_table = document
|
||||
.getElementById("repo-files-table")
|
||||
|
||||
if (repo_files_table) {
|
||||
repo_files_table = repo_files_table.getElementsByTagName("tr")
|
||||
data += "\n## Files\n\n"
|
||||
for (let i = 2; i < repo_files_table.length; i++) {
|
||||
let table_element = repo_files_table[i]
|
||||
let file_info = table_element.innerText.trim().replace(/\t.*$/, "")
|
||||
let file_link = table_element.querySelector("a")
|
||||
if (file_link) {
|
||||
file_link = window.electron.abs_href(file_link.getAttribute("href"))
|
||||
}
|
||||
|
||||
data += "=> " + file_link + " " + file_info + "\n"
|
||||
}
|
||||
}
|
||||
|
||||
var readme_nodes = repo_node
|
||||
.getElementsByClassName("file-view markdown markdown")
|
||||
if (readme_nodes.length !== 0) {
|
||||
readme_nodes = readme_nodes[0].children
|
||||
data += "\n----------\n"
|
||||
|
||||
for (let i = 0; i < readme_nodes.length; i++) {
|
||||
let readme_node = readme_nodes[i]
|
||||
let tag_name = readme_node.tagName
|
||||
if (tag_name.startsWith("H") && tag_name.length === 2) {
|
||||
let header_lvl = tag_name[1]
|
||||
data += "\n" + "#".repeat(header_lvl) + " " + readme_node.innerText
|
||||
} else if (tag_name === "P") {
|
||||
data += readme_node.innerText
|
||||
} else if (tag_name === "UL") {
|
||||
let list_items = readme_node.children
|
||||
for (let j = 0; j < list_items.length ; j++) {
|
||||
list_item = list_items[j]
|
||||
data += "\n* " + list_item.innerText.replaceAll("\n", "\n\t - ")
|
||||
}
|
||||
} else if (tag_name === "PRE") {
|
||||
data += "```\n" + readme_node.innerText + "```\n"
|
||||
}
|
||||
data += "\n"
|
||||
}
|
||||
}
|
||||
window.electron.send_gemtext(data)
|
||||
} else {
|
||||
window.electron.send_gemtext(window.electron.default_sigil())
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIFCTCCAvGgAwIBAgIUY5J0vNCb4udzvi9A7qe/DrlCnBQwDQYJKoZIhvcNAQEL
|
||||
BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIxMDQyMjAzNDU1NloXDTIyMDQy
|
||||
MjAzNDU1NlowFDESMBAGA1UEAwwJbG9jYWxob3N0MIICIjANBgkqhkiG9w0BAQEF
|
||||
AAOCAg8AMIICCgKCAgEAyt0SljPnOj18Xkq74tuf/CAgOUFoa1DGEbJ9pyeDQ+68
|
||||
rfaGcQzvC1e3NPAoEqO8gLlsYgnxCK308ZeO34LkhA/yrbsgWx02WLYlzZ0fFYas
|
||||
+0K+1xrhPsLURm0aAMVI60pIPoTBXi/fqfV21k32X5lS/c3PZpbmt0l+mVHzWy8+
|
||||
OpHt05qaBB/rB3LD2RGwJVZwBWWeJI1kb3wfpN0+fMoo/4cgpAVaZ2Uak8NoswEP
|
||||
hVCcMo/WJF0+Ik9Mtl6V5OAwt1u2Pp5W4OzMYkQJhlV1w8ufhEYxBAOVXTxQ5Lu1
|
||||
iqztipyx1g8mpEyEi3e0MrysxKfkgEZxeSvHdIEwVf+sStPAFBPJjEcQJgCzQtns
|
||||
EPMGqbghPU6Swpil3nKQ/93HEfhw4LjWrG9Mp9DptmPu9fzah028BgkLfWMRHhgp
|
||||
lKQV6wSy+8AdlNDOb0Q8xawt7/RDfgPJF5lsPfi3lVToGAU/9mWhckaZlgEU20hC
|
||||
PiH6O9PxMlZ62Ch3VEhR8XUSI3g0rqPHsJqDlZZl26pCLOvECpHhTln43/3mx75X
|
||||
Rld04EpeZ9S2sJGXghdBn0NIEGlG7w1DulQLS9gkZGE8Y9PnLUrnWlLuyY99oLzL
|
||||
xpAF37O2vYZGlFYt9BWZ2yav+QJU9PGP+18jOgHiS/QvfJ9mcEMKqp1UXeCIPSsC
|
||||
AwEAAaNTMFEwHQYDVR0OBBYEFK5WqeRNQdkSBwv5j/FlzfxvN9qYMB8GA1UdIwQY
|
||||
MBaAFK5WqeRNQdkSBwv5j/FlzfxvN9qYMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI
|
||||
hvcNAQELBQADggIBAMYJ9rLpISXjgNuQ4VM8tXlikCeWVaPfUvQnhjW5UKFGR/Hj
|
||||
d0KRpzNw0YlvVO3mTYy3mMAjws0k8kFqTkWftwg6C4B7FIuFpJK3eJnYXrhiyGSp
|
||||
dp3l6ASSYyl6QeHruyIV9u+n8yyeV88gqjgK3T22OoZdmEXSkkMZ4KL4hIE8hYb6
|
||||
BV5aAYh+QlxyHBMuB1ZUa9d9K+0WUA/4ykp9kOrpUnUJ8WdaUKbWGHR0SrKXFDsV
|
||||
W58VpWzymZwUxqIC8uMFSzXMEhwU87t23Azzob1vdp2cc5tOplzIo317wtdhyjro
|
||||
/CjuNt6hqeduMjXz+jku2fwk51le0mhE3Qr+CqjVg8Qp0ffrmX69W+2St9tbxkmN
|
||||
yOhyZw55W3j3/16+VZTaGMQhQwMxszMVBebKIaPXiBDbvWcDahPknESY6bBIicSY
|
||||
W2a6l0Ao01+6/PwqKGGi353FWgn7Bm4coXuLPMseBuwBhc4/kUXMc80+XZyrEIUO
|
||||
FNaEnbZ4YcP/Fqmi6BLRslUgpIpCkttr0XnuE3wA7gdH+pOS/Hxfk7xAJvNByR93
|
||||
nGkN3+fLGyQI+9fI241ce8MQevDgC9DSvZGw1UQEq+RX9DGjpK26Iyu+UrjMhIMW
|
||||
X002hHQ0E/OZXbTUVwv3G3lPFlUBZbUH/BTjG8mnmn+RxJToe/JhqXI9qIS3
|
||||
-----END CERTIFICATE-----
|
|
@ -0,0 +1,52 @@
|
|||
-----BEGIN PRIVATE KEY-----
|
||||
MIIJRAIBADANBgkqhkiG9w0BAQEFAASCCS4wggkqAgEAAoICAQDK3RKWM+c6PXxe
|
||||
Srvi25/8ICA5QWhrUMYRsn2nJ4ND7ryt9oZxDO8LV7c08CgSo7yAuWxiCfEIrfTx
|
||||
l47fguSED/KtuyBbHTZYtiXNnR8Vhqz7Qr7XGuE+wtRGbRoAxUjrSkg+hMFeL9+p
|
||||
9XbWTfZfmVL9zc9mlua3SX6ZUfNbLz46ke3TmpoEH+sHcsPZEbAlVnAFZZ4kjWRv
|
||||
fB+k3T58yij/hyCkBVpnZRqTw2izAQ+FUJwyj9YkXT4iT0y2XpXk4DC3W7Y+nlbg
|
||||
7MxiRAmGVXXDy5+ERjEEA5VdPFDku7WKrO2KnLHWDyakTISLd7QyvKzEp+SARnF5
|
||||
K8d0gTBV/6xK08AUE8mMRxAmALNC2ewQ8wapuCE9TpLCmKXecpD/3ccR+HDguNas
|
||||
b0yn0Om2Y+71/NqHTbwGCQt9YxEeGCmUpBXrBLL7wB2U0M5vRDzFrC3v9EN+A8kX
|
||||
mWw9+LeVVOgYBT/2ZaFyRpmWARTbSEI+Ifo70/EyVnrYKHdUSFHxdRIjeDSuo8ew
|
||||
moOVlmXbqkIs68QKkeFOWfjf/ebHvldGV3TgSl5n1LawkZeCF0GfQ0gQaUbvDUO6
|
||||
VAtL2CRkYTxj0+ctSudaUu7Jj32gvMvGkAXfs7a9hkaUVi30FZnbJq/5AlT08Y/7
|
||||
XyM6AeJL9C98n2ZwQwqqnVRd4Ig9KwIDAQABAoICAQCI60clO6jgBSnQ1m4Tgppr
|
||||
aB93pW7dp6nXvfnS/Pc6vYJ5g79fxBP/Ote7ki/pzLtowj2lugIGEqsU+G8E6mpj
|
||||
vAPWQEtpU8EfhOjk6xxUwg40k+sMceb/Hi55zh9Tz9QUgpFaKO3+LR+vra3knMAh
|
||||
6/E4vlUyb70Ojjs1LjurGqrMizvSqzEygXx3DX2kH60ctkdrTRe8ofXczRDqjC0l
|
||||
uqiLNt/P9JD84h9bBfO/hYK9Pxf9hFlLN+e87nrfR92xmaMnzm2lu+b1br3PwQ4Q
|
||||
rdOLL/7dHybsB6MjR5dtmkfAblDxUisxSA6Tq9V18HgeGnwdSxgNf/4Mg4DeYGeH
|
||||
H2jBiBhDju1VuQOEXT06QDy/1mvabWqNyXkJdU8Wq7EZhvVY6zC2JZuzjJNCrGCM
|
||||
p+T9o+kLsfNpgjKmkyGkAiZJzOzkD+MeBmakAgqgcXzwvx+vm8r2sdJOsxhB3Zm8
|
||||
3r+Rx2xOBRQFZg66BqmGjcchYgOeMuZKgvJBjBsppVjkvPSR3CtEXfi4BWaL3qZ5
|
||||
Pc6ZuerrLhNu3DtClX/dROaOkwjsQDeUoCI0oooeuQujZ4P/NmMwFh3jX8KlJ8W3
|
||||
bHh6GN8tDrg/PVv5EHsOIA1x9S1uNasBdIvLcGxxw+1rUhXhvw3Vk3xnYmQR1ZsY
|
||||
B0lY/a7QHyMWR7FJBpbj2QKCAQEA9ElZ7QZE/oO8ydKhJRe2Q/q/68Xs+FUsXadd
|
||||
bXwh4xa/pI+O3aLtHXHvWXGCY9YIlyF+/hpDdDKEXgeVJzf3UVo1OZ4xRqPc2f/E
|
||||
GGkmPwabanbv+gDDroaREOcG2cFcrTo2LhP7s9w7tBMwxO1Y3vkQP/zjaxOA2Wts
|
||||
cQ7buEe0vxKAqv4c/lNm7/HfNF05IaX/x9Vd3+yna+MmHTkJmvw0jW+zdhFuu269
|
||||
i+NixHutOS7xKD7pilaSmKFS9MuTeiLhQcS7VHzF4kmZ8tVMuCKljNxwUfz5Wl+2
|
||||
ajMgZp9Vu0GVwcIRhlv0MjmR81RzyixkZ1ubjntbA5VucU8D3wKCAQEA1Jc/xNRU
|
||||
VBFsfFMRzxGCAlrProamzp5+c+F/uEWC1MFypmNIsZzHXAVY+g9C8dGG9ozVE+3v
|
||||
zxoBy3KbTSVcZL6N71KDBEuoqBTySjKDoUsaXpqMyRedG3Q22p3mPbCrdx0NSCNg
|
||||
XhsEMnxk5CnLU5/8S1oIDuzEeGKgEvxlXkUVlRDTdADdASDX15fJq/HAab2Caqts
|
||||
QbtZncVDWDS+fJm78ewhfCPgbZs9MmEF/wIWQEvLJD3oEYgIVjUNLrr1u8fQ0nMo
|
||||
lUDhglSq1+F0FJ0USanRVc7QmZR2zFoB8O0t8aYTiniwuVFUwLNYTndbLKA5fEjF
|
||||
K/72LbxQruGQNQKCAQEApmXEhGiN3JQdp5f6vkptk9acnlw+s1VJGC4lvKseZhIb
|
||||
zlsfJKeTPkhakiF4gMrNJSzi1PFM2zyB347osUM1CswYjzvLMuPxTukiSMJvE+VL
|
||||
PfTwN+oHYL022T2U9AT7PN/3AeIIxJYScPHVeX5218Ltp7h5rHknfnHm9wf48Iif
|
||||
fLt8u3zGgRKMforR0FhjzyDEnvkeraYE0L90OdmdSl3a6jCZHKZ5N+ER6dSkdVQN
|
||||
RXNNP23DJMEdsCvLVwXIWhyiNWttcvpezGn4HGngjVjETbPmKmLX8xBZL/PNcTm9
|
||||
awUcnlO0HkJKj1+ZpBb1nFQqvCCxUBeEgmdqSHJbHwKCAQB2a1HwOD5JHfOKRVOU
|
||||
PrJm0WMCWqssSQkzT5cvdDjuflt457EkjqpWTfxEPqARx58gU06V7WI5wMjjJRHx
|
||||
JTCURbkWaKXmjKaECjb0sbK08/raW8i0c1zmYBP2LyKDlpfMn/g4CMyzXuU1oikp
|
||||
F0bVbDbDWoFGnwjJ7lYwfTuSCXV+NYM0CQ8Sg9L3muuRxfZicFfnR1nkO5It2iYr
|
||||
SiYZjiEtH1V/qxRmuaSbHYSTifwPEKk1pO5SZa4PJzoSn74mPaXKtK8UhLGZQcRw
|
||||
wHtCyET2y4t5+twj0JlkN3cBV3zSMKqN5bC7adyGAuDbxIybDR04Z+i9GybSTyW6
|
||||
ZJdJAoIBAQDLAjVFa9ApuwIFdc8c3IOlp/YOlUdSrmPPzqS+deghhhEjkYjc60FJ
|
||||
Acvezo03h0jp2jsk8QCNLHfglmdy3ilJrct832qZAjEkTV7H55/KZm2Z/1S74exr
|
||||
3FNblWNwIiBNbaqM/K9NSX8hZGexHTiZ8S6JEQdm111EYiifUN0LTDJkYPPjhxRv
|
||||
YXPk1q2MB/bEa3X/w81zaDLmUViXDp1hDW2EahtLAapvvRs3aQ3hRilvSBkonQ5E
|
||||
vkTcuKEbUse5U+hd4HtX4Wi+vkCzazzrrWEenJoImx6wBhe+uv/mu8PdJnbLIJbh
|
||||
A+0xklCnyaSsl5sQBB8+KTiVvqEMysfo
|
||||
-----END PRIVATE KEY-----
|
|
@ -0,0 +1,79 @@
|
|||
# how to write a sigil
|
||||
## requirements
|
||||
- a text editor
|
||||
- a browser
|
||||
- some knowledge of javascript
|
||||
|
||||
## getting started
|
||||
Say we want to write a sigil for "https://time.is" to get the current times
|
||||
around the world and serve them in gemtext format. Our first step is to create
|
||||
the file `time.is` and place it in the `sigils` directory.
|
||||
|
||||
## writing the sigil
|
||||
The only necessary part of any sigil is the call to
|
||||
`window.electron.send_gemtext()`. This function sends any data generated in
|
||||
the browser to the web server.
|
||||
|
||||
To start, we can write our sigil `time.is` to consist only of the
|
||||
line:
|
||||
```
|
||||
window.electron.send_gemtext("This is a test.")
|
||||
```
|
||||
|
||||
Now, whenever you access "gemini://localhost?https://time.is"
|
||||
you will be greeted with:
|
||||
```
|
||||
This is a test.
|
||||
```
|
||||
Great! This is not very useful however, as we aren't getting any data from the
|
||||
page.
|
||||
|
||||
So, lets add some data! If we navigate to "https://time.is" using a web
|
||||
browser, we can see the current time for the user's location is displayed near
|
||||
the top of the page. Using the "inspect element" feature we can see that the
|
||||
current time is contained in a `time` element with the id `clock`. If we want
|
||||
to use this data in our sigil, we can access it using
|
||||
`document.querySelector()`, the same way we would in the browser console:
|
||||
```
|
||||
var current_time = document.querySelector("time#clock").innerText
|
||||
```
|
||||
|
||||
Now, if we want our sigil to send that data, we simply write:
|
||||
```
|
||||
window.electron.send_gemtext(current_time)
|
||||
```
|
||||
|
||||
So now our sigil `time.is` looks like this:
|
||||
```
|
||||
var current_time = document.querySelector("time#clock").innerText
|
||||
window.electron.send_gemtext(current_time)
|
||||
```
|
||||
|
||||
And now, when we access "gemini://localhost?https://time.is", we see:
|
||||
```
|
||||
4:29:36pm
|
||||
```
|
||||
(or whatever the time is in your current location)
|
||||
|
||||
If we want to display the current date as well, we can find it in the `div` element with id `dd`
|
||||
```
|
||||
var current_date = document.querySelector("div#dd").innerText
|
||||
```
|
||||
|
||||
And send the entire thing as a string back to the web server:
|
||||
```
|
||||
var current_time = document.querySelector("time#clock").innerText
|
||||
var current_date = document.querySelector("div#dd").innerText
|
||||
window.electron.send_gemtext(current_time + "\n\n" + current_date)
|
||||
```
|
||||
|
||||
Now, when we access "gemini://localhost?https://time.is" we see:
|
||||
```
|
||||
4:38:02pm
|
||||
|
||||
Friday, April 23, 2021
|
||||
```
|
||||
|
||||
Of course, sigils can be much more powerful than this. For a good example of a
|
||||
more complex sigil, you can see the `*.sr.ht` sigil for viewing sourcehut
|
||||
repos.
|
Loading…
Reference in New Issue