From 8fe7d4e55737f04a7e031febea1b045eb0c2af21 Mon Sep 17 00:00:00 2001 From: Emily Date: Fri, 9 Apr 2021 23:49:42 +0200 Subject: [PATCH 1/2] Check if searchsquare is defined Removes a global variable Fixes an error when `searchsquare` is undefined and `alwaysopen == true` --- src/js/load-config.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/js/load-config.js b/src/js/load-config.js index 7ea5aba..356e76d 100644 --- a/src/js/load-config.js +++ b/src/js/load-config.js @@ -373,7 +373,8 @@ function applyConfig(data, callback) { while(container.firstChild) { container.removeChild(container.firstChild); } - normalSquares = []; + let normalSquares = []; + let searchsquare = undefined; for(let i = 0; i < data.squares.length; i++) { if(data.squares[i].links) { normalSquares[i] = new Square(data.squares[i].name, @@ -418,9 +419,11 @@ function applyConfig(data, callback) { maxHeight = normalSquares[i].maxHeight(); } } - let sMaxHeight = searchsquare.maxHeight(); - if(searchsquare && sMaxHeight > maxHeight) { - maxHeight = sMaxHeight; + if(searchsquare) { + let sMaxHeight = searchsquare.maxHeight(); + if(sMaxHeight > maxHeight) { + maxHeight = sMaxHeight; + } } sqr.css("height", px(maxHeight)); } else { From 4bec8d612b3546f9342b703be2679a8c1664c4e9 Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 10 Apr 2021 00:04:24 +0200 Subject: [PATCH 2/2] Bump version and update changelog --- CHANGELOG.md | 5 +++++ package.json | 2 +- src/manifest.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c46ca4..c0b055b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/). +## [1.11.3] - 2021-4-10 +### Fixed +* Fixes an error when `searchsquare` is undefined and `alwaysopen == true` + ## [1.11.2] - 2020-8-8 ### Changed * Made duckduckgo the default search engine in the default config @@ -51,6 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). * `filter`: An optional filter, e.g. `opacity(0.2)` +[1.11.3]: https://github.com/etacarinaea/startpage/compare/v1.11.2...v1.11.3 [1.11.2]: https://github.com/etacarinaea/startpage/compare/v1.11.1...v1.11.2 [1.11.1]: https://github.com/etacarinaea/startpage/compare/v1.11.0...v1.11.1 [1.11.0]: https://github.com/etacarinaea/startpage/compare/v1.10.0...v1.11.0 diff --git a/package.json b/package.json index bed6acc..d4524a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "startpage", - "version": "1.11.2", + "version": "1.11.3", "description": "Overrides the browsers newtab page with a custom startpage.", "main": "src/index.js", "devDependencies": { diff --git a/src/manifest.json b/src/manifest.json index 7025f29..d0a3117 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "startpage", "short_name": "startpage", - "version": "1.11.2", + "version": "1.11.3", "description": "Overrides the browsers newtab page with a custom startpage.", "author": "etacarinaea",