Delete custom on-error page

This commit is contained in:
Ilya Ig. Petrov 2017-05-28 18:42:43 +05:00
parent 9c5d3a5ea5
commit 88792658aa
2 changed files with 0 additions and 62 deletions

View File

@ -1,32 +0,0 @@
<!DOCTYPE html>
<html style="display: none; will-change: contents, display">
<head>
<meta charset="utf-8">
<title>Обход ошибки</title>
<style>
html, body, ol, ul, li {
margin: 0;
padding: 0;
}
body {
margin: 1em;
}
.nowrap {
display: block;
white-space: nowrap;
word-break: keep-all;
}
li {
margin: 0.5em 1em;
}
a:not(:hover) {
text-decoration: none;
}
</style>
</head>
<body>
<ol id="menuItems" class="nowrap"></ol>
<script src="./index.js"></script>
<script src="../lib/keep-links-clickable.js"></script>
</body>
</html>

View File

@ -1,30 +0,0 @@
'use strict';
chrome.runtime.getBackgroundPage( (bgWindow) =>
bgWindow.apis.errorHandlers.installListenersOn(
window, 'ERRM', async() => {
const [currentTab] = await new Promise((resolve) =>
chrome.tabs.query({
active: true,
currentWindow: true,
}, resolve)
);
const itemsRoot = document.getElementById('menuItems');
bgWindow.apis.menus.getItemsAsArray().forEach((item) => {
const li = document.createElement('li');
li.innerHTML = `
<a href>${item.title}</a>
`;
li.querySelector('a').href = item.getUrl(currentTab.url);
itemsRoot.appendChild(li);
});
document.documentElement.style.display = 'initial';
}
)
);