Skip to content

Commit

Permalink
A bit closer to mobile meme editing
Browse files Browse the repository at this point in the history
  • Loading branch information
rberenguel committed Dec 1, 2024
1 parent 4b8e190 commit 029ae5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ const basepath = "../"; // This is working weirdly now, for some reason

document.addEventListener(
"DOMContentLoaded",
setupAllTheThings(white, basepath),
setupAllTheThings(white, basepath, window.location.pathname.includes("pwa/")),
);
5 changes: 4 additions & 1 deletion src/screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const sourceLinkDiv = () => document.getElementById("sourceLink");
const filterText = document.getElementById("filter-text");
const filteredMemes = document.getElementById("filtered-memes");

const setupAllTheThings = (testImage, basepath) => () => {
const setupAllTheThings = (testImage, basepath, hideUrl) => () => {
try {
chrome.storage.local.set({ linkback: true });
chrome.storage.local.get(["screenshot", "url"], screenshotHandler);
Expand All @@ -107,6 +107,9 @@ const setupAllTheThings = (testImage, basepath) => () => {
linkElement.textContent = result.url; // Set the link text
linkElement.target = "_blank"; // Open link in a new tab
sourceLinkDiv().appendChild(linkElement);
if(hideUrl){
sourceLinkDiv().classList.add("hide")
}

// Set SVG viewport after image loads
img.onload = function () {
Expand Down

0 comments on commit 029ae5e

Please sign in to comment.