Skip to content

Commit

Permalink
[CLEANUP] minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishabhg71 committed Oct 9, 2023
1 parent a0305f3 commit fddddd6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';",
"sandbox": "sandbox allow-scripts allow-downloads allow-forms allow-popups allow-modals; script-src 'self' 'unsafe-inline' 'unsafe-eval'; child-src 'self'; frame-src library.kiwix.org"
"sandbox": "sandbox allow-scripts allow-downloads allow-forms allow-popups allow-modals; script-src 'self' 'unsafe-inline' 'unsafe-eval'; child-src 'self';"
},
"web_accessible_resources": [{
"resources": ["www/index.html", "www/article.html"],
Expand Down
1 change: 1 addition & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const config = {
// Prevent a fatal error in IE11 (bug with the URL constructor polyfill)
'document.baseURI': "document.location.href.replace(/[^/]*$/, '')",
// Redirect the libzim Worker loader to the new location
'js/lib/libzim': 'js/libzim',
'js/lib/darkreader.min.js': 'js/darkreader.min.js',
preventAssignment: true
}),
Expand Down
11 changes: 5 additions & 6 deletions www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ function resizeIFrame () {
const headerStyles = getComputedStyle(document.getElementById('top'));
const articleContent = document.getElementById('articleContent');
const libraryContent = document.getElementById('libraryContent');
const frames = [articleContent, libraryContent]
const frames = [articleContent, libraryContent];
const region = document.getElementById('search-article');
const nestedFrame = libraryContent.contentWindow.document.getElementById('libraryIframe')
const nestedFrame = libraryContent.contentWindow.document.getElementById('libraryIframe');
// window.postMessage(window.innerHeight, '*');

for (let i = 0; i < frames.length; i++) {
Expand Down Expand Up @@ -1318,10 +1318,9 @@ document.getElementById('libraryBtn').addEventListener('click', function (e) {
Function('try{}catch{}')();
iframe.setAttribute('src', params.libraryUrl);
} catch (error) {
const fakeElement = document.createElement('a')
fakeElement.setAttribute('href', params.altLibraryUrl)
uiUtil.warnAndOpenExternalLinkInNewTab(e, fakeElement)
// window.open(params.altLibraryUrl, '_blank');
const fakeElement = document.createElement('a');
fakeElement.setAttribute('href', params.altLibraryUrl);
uiUtil.warnAndOpenExternalLinkInNewTab(e, fakeElement);
}
});

Expand Down

0 comments on commit fddddd6

Please sign in to comment.