Merge pull request #11 from EthanHarv/main

Fix image loading && Add visual separation for multiple solutions
This commit is contained in:
Alan Li 2021-07-15 19:24:51 +08:00 committed by GitHub
commit 38b6b93388
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 3 deletions

View file

@ -48,7 +48,7 @@ or use
git clone https://github.com/lebr0nli/slader-extension.git
2. Select the file **slader_bypass-0.3-fx.xpi** in **slader-extension-main**
2. Select the file **slader_bypass-0.7-fx.xpi** in **slader-extension-main**
3. Drag the file into the URL bar, click "add" when prompted

View file

@ -42,7 +42,14 @@ function processData(data){
var qDetails = JSON.parse(json[0]);
var solutions = (qDetails.question || qDetails.exercise).solutions;
// Display JSON data as answer
solutionNum = 0;
solutions.forEach(solution => {
solutionNum++;
expArea.appendChild(document.createElement('hr'));
var h1 = document.createElement('h1');
h1.textContent = 'Solution ' + solutionNum + ":";
expArea.appendChild(h1);
const numSteps = solution.steps.length;
solution.steps.forEach(step => {
const stepNum = step.stepNumber;
@ -76,7 +83,7 @@ function processData(data){
}
// Append server-rendered image src url. Used in errorhandling. (See: handleKatexError())
if (column.images.latex.large)
if (column.images.latex && column.images.latex.large)
{
div.querySelector('.sladerBypassKatex').setAttribute('katexsrc', column.images.latex.large.srcUrl);
}

View file

@ -1,6 +1,6 @@
{
"name": "slader bypass",
"version": "0.4",
"version": "0.7",
"author":"Alan Li & Ethan Harvey",
"description": "Slader/Quizlet 5 solutions limit bypass",
"permissions": [