*Update references of .skynet to .lume
This commit is contained in:
parent
d37926dd84
commit
7efd901b97
|
@ -15,9 +15,9 @@ export default class InternalProvider extends BaseProvider {
|
||||||
details: OnBeforeRequestDetailsType
|
details: OnBeforeRequestDetailsType
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
return [
|
return [
|
||||||
"http://kernel.skynet/",
|
"http://kernel.lume/",
|
||||||
"http://kernel.skynet/auth.html",
|
"http://kernel.lume/auth.html",
|
||||||
"http://kernel.skynet/favicon.ico",
|
"http://kernel.lume/favicon.ico",
|
||||||
].includes(details.url);
|
].includes(details.url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ export default class InternalProvider extends BaseProvider {
|
||||||
): Promise<BlockingResponse | boolean> {
|
): Promise<BlockingResponse | boolean> {
|
||||||
// For the kernel, we swallow the entire page. The 'bootloader' content
|
// For the kernel, we swallow the entire page. The 'bootloader' content
|
||||||
// script will everything that we need.
|
// script will everything that we need.
|
||||||
if (details.url === "http://kernel.skynet/") {
|
if (details.url === "http://kernel.lume/") {
|
||||||
// Get the filter and swallow any response from the server.
|
// Get the filter and swallow any response from the server.
|
||||||
let filter = browser.webRequest.filterResponseData(details.requestId);
|
let filter = browser.webRequest.filterResponseData(details.requestId);
|
||||||
filter.onstart = () => {
|
filter.onstart = () => {
|
||||||
|
@ -37,7 +37,7 @@ export default class InternalProvider extends BaseProvider {
|
||||||
|
|
||||||
// For the favicon, we make a request to a content script that has access
|
// For the favicon, we make a request to a content script that has access
|
||||||
// to the favicon.
|
// to the favicon.
|
||||||
if (details.url === "http://kernel.skynet/favicon.ico") {
|
if (details.url === "http://kernel.lume/favicon.ico") {
|
||||||
// Send a message to the kernel requesting an override for the
|
// Send a message to the kernel requesting an override for the
|
||||||
// favicon.ico. The kernel is itself loading this favicon from the
|
// favicon.ico. The kernel is itself loading this favicon from the
|
||||||
// browser, I just wasn't certain how to get binary objects directly to
|
// browser, I just wasn't certain how to get binary objects directly to
|
||||||
|
@ -68,7 +68,7 @@ export default class InternalProvider extends BaseProvider {
|
||||||
|
|
||||||
// For the favicon, we make a request to a content script that has access
|
// For the favicon, we make a request to a content script that has access
|
||||||
// to the favicon.
|
// to the favicon.
|
||||||
if (details.url === "http://kernel.skynet/auth.html") {
|
if (details.url === "http://kernel.lume/auth.html") {
|
||||||
// Send a message to the kernel requesting an override for the auth
|
// Send a message to the kernel requesting an override for the auth
|
||||||
// page. The kernel is itself loading the auth page from the browser, I
|
// page. The kernel is itself loading the auth page from the browser, I
|
||||||
// just wasn't certain how to get binary objects directly to the
|
// just wasn't certain how to get binary objects directly to the
|
||||||
|
@ -105,8 +105,8 @@ export default class InternalProvider extends BaseProvider {
|
||||||
details: OnHeadersReceivedDetailsType
|
details: OnHeadersReceivedDetailsType
|
||||||
): Promise<OnRequestDetailsType | boolean> {
|
): Promise<OnRequestDetailsType | boolean> {
|
||||||
if (
|
if (
|
||||||
details.url === "http://kernel.skynet/" ||
|
details.url === "http://kernel.lume/" ||
|
||||||
details.url === "http://kernel.skynet/auth.html"
|
details.url === "http://kernel.lume/auth.html"
|
||||||
) {
|
) {
|
||||||
let headers = [
|
let headers = [
|
||||||
{
|
{
|
||||||
|
@ -118,7 +118,7 @@ export default class InternalProvider extends BaseProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
// For the favicon, replace the headers with png headers.
|
// For the favicon, replace the headers with png headers.
|
||||||
if (details.url === "http://kernel.skynet/favicon.ico") {
|
if (details.url === "http://kernel.lume/favicon.ico") {
|
||||||
let headers = [
|
let headers = [
|
||||||
{
|
{
|
||||||
name: "content-type",
|
name: "content-type",
|
||||||
|
@ -133,7 +133,7 @@ export default class InternalProvider extends BaseProvider {
|
||||||
|
|
||||||
async handleProxy(details: OnRequestDetailsType): Promise<any> {
|
async handleProxy(details: OnRequestDetailsType): Promise<any> {
|
||||||
const hostname = new URL(details.url).hostname;
|
const hostname = new URL(details.url).hostname;
|
||||||
if (hostname === "kernel.skynet") {
|
if (hostname === "kernel.lume") {
|
||||||
return requestProxies;
|
return requestProxies;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ export function queryKernel(query: any): Promise<any> {
|
||||||
if (getKernelIframe().contentWindow !== null) {
|
if (getKernelIframe().contentWindow !== null) {
|
||||||
(getKernelIframe() as any).contentWindow.postMessage(
|
(getKernelIframe() as any).contentWindow.postMessage(
|
||||||
query,
|
query,
|
||||||
"http://kernel.skynet"
|
"http://kernel.lume"
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
console.error(
|
console.error(
|
||||||
|
@ -90,7 +90,7 @@ function handleKernelMessage(event: MessageEvent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.origin !== "http://kernel.skynet") {
|
if (event.origin !== "http://kernel.lume") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ function handleBridgeMessage(
|
||||||
});
|
});
|
||||||
data["domain"] = domain;
|
data["domain"] = domain;
|
||||||
}
|
}
|
||||||
getKernelIframe().contentWindow!.postMessage(data, "http://kernel.skynet");
|
getKernelIframe().contentWindow!.postMessage(data, "http://kernel.lume");
|
||||||
}
|
}
|
||||||
function bridgeListener(port: any) {
|
function bridgeListener(port: any) {
|
||||||
let portNonce = getPortsNonce();
|
let portNonce = getPortsNonce();
|
||||||
|
@ -211,7 +211,7 @@ async function boot() {
|
||||||
engine.registerContentProvider(new ServerProvider(engine));
|
engine.registerContentProvider(new ServerProvider(engine));
|
||||||
|
|
||||||
setKernelIframe(document.createElement("iframe"));
|
setKernelIframe(document.createElement("iframe"));
|
||||||
getKernelIframe().src = "http://kernel.skynet";
|
getKernelIframe().src = "http://kernel.lume";
|
||||||
getKernelIframe().onload = init;
|
getKernelIframe().onload = init;
|
||||||
document.body.appendChild(getKernelIframe());
|
document.body.appendChild(getKernelIframe());
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ var browser: any; // tsc
|
||||||
const defaultKernelResolverLink =
|
const defaultKernelResolverLink =
|
||||||
"AQDJDoXMJiiEMBxXodQvUV89qtQHsnXWyV1ViQ9M1pMjUg";
|
"AQDJDoXMJiiEMBxXodQvUV89qtQHsnXWyV1ViQ9M1pMjUg";
|
||||||
|
|
||||||
document.title = "kernel.skynet";
|
document.title = "kernel.lume";
|
||||||
let header = document.createElement("h1");
|
let header = document.createElement("h1");
|
||||||
header.textContent =
|
header.textContent =
|
||||||
"Something went wrong! You should not be visiting this page, this page should only be accessed via an invisible iframe.";
|
"Something went wrong! You should not be visiting this page, this page should only be accessed via an invisible iframe.";
|
||||||
|
@ -170,7 +170,7 @@ function handleSkynetKernelRequestOverride(event: MessageEvent) {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (event.data.data.url === "http://kernel.skynet/favicon.ico") {
|
if (event.data.data.url === "http://kernel.lume/favicon.ico") {
|
||||||
blockForFavicon.then(() => {
|
blockForFavicon.then(() => {
|
||||||
let headers = [
|
let headers = [
|
||||||
{
|
{
|
||||||
|
@ -183,7 +183,7 @@ function handleSkynetKernelRequestOverride(event: MessageEvent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.data.data.url === "http://kernel.skynet/auth.html") {
|
if (event.data.data.url === "http://kernel.lume/auth.html") {
|
||||||
blockForAuthPage.then(() => {
|
blockForAuthPage.then(() => {
|
||||||
let headers = [
|
let headers = [
|
||||||
{
|
{
|
||||||
|
@ -457,21 +457,4 @@ function checkForLoadKernel() {
|
||||||
loadKernel();
|
loadKernel();
|
||||||
}
|
}
|
||||||
|
|
||||||
let accessFailedStr =
|
checkForLoadKernel();
|
||||||
"unable to get access to localStorage, user may need to reduce their privacy settings";
|
|
||||||
if (
|
|
||||||
Object.prototype.hasOwnProperty.call(document, "requestStorageAccess") &&
|
|
||||||
window.origin === "https://skt.us"
|
|
||||||
) {
|
|
||||||
document
|
|
||||||
.requestStorageAccess()
|
|
||||||
.then(() => {
|
|
||||||
checkForLoadKernel();
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
log(addContextToErr(err, accessFailedStr));
|
|
||||||
sendAuthUpdate();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
checkForLoadKernel();
|
|
||||||
}
|
|
||||||
|
|
|
@ -273,7 +273,7 @@ export default class WebEngine {
|
||||||
|
|
||||||
this.navigations.set(this.getNavigationId(details), promise);
|
this.navigations.set(this.getNavigationId(details), promise);
|
||||||
|
|
||||||
if ("kernel.skynet" === queriedHost) {
|
if ("kernel.lume" === queriedHost) {
|
||||||
if (!queriedUrl.includes("://")) {
|
if (!queriedUrl.includes("://")) {
|
||||||
queriedUrl = `http://${queriedUrl}`;
|
queriedUrl = `http://${queriedUrl}`;
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue