Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari version? #15

Open
LuiFerreiraD opened this issue Apr 16, 2024 · 4 comments
Open

Safari version? #15

LuiFerreiraD opened this issue Apr 16, 2024 · 4 comments

Comments

@LuiFerreiraD
Copy link

Will there be a Safari extension anytime?

@Dhravya
Copy link
Owner

Dhravya commented Apr 16, 2024

right now it's just me and @yxshv developing it so supporting a safari extension would be quite time consuming for us.

we have big goals with this project, so we will first work on that and then with enough bandwidth, will make the extension!

@appden
Copy link

appden commented Apr 16, 2024

Haven't tried it yet, but Apple provides an automatic converter: Converting a web extension for Safari

@ali2kan
Copy link

ali2kan commented Apr 16, 2024

A bookmarket could also work. It looks like it could be adapted from the sendUrlToAPI function you have in the extension app. And change the backendUrl when selfhosting. I'll give it a once i get it up and running self hosing. There could be issues with CORS.

Here's a very rough bookmarket

javascript: (function() {
  const endpoints = [
    'https://your-production-api-endpoint.com/api/',  // Production API endpoint
    'http://localhost:3000/api/'                     // Development API endpoint
  ];
  const data = { url: window.location.href };  // Data to be sent

  Promise.all(endpoints.map(url =>
    fetch(url, {
      method: 'POST',   // Use 'POST' or 'GET' as required by your API
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(data)
    })
    .then(response => {
      if (!response.ok) {
        throw new Error(`Failed to save at ${url}: ${response.statusText}`);
      }
      return response.json();
    })
  ))
  .then(results => {
    alert('Website saved successfully to all endpoints!');
  })
  .catch(error => {
    console.error('Error:', error);
    alert('Error occurred: ' + error.message);
  });
})();

One-Line format

javascript:(function(){const endpoints=['https://your-production-api-endpoint.com/api/','http://localhost:3000/api/'];const data={url:window.location.href};Promise.all(endpoints.map(url=>fetch(url,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(data)}).then(response=>{if(!response.ok){throw new Error(`Failed to save at ${url}: ${response.statusText}`);}return response.json();}))).then(results=>{alert('Website saved successfully to all endpoints!');}).catch(error=>{console.error('Error:',error);alert('Error occurred: '+error.message);});})();

@Dhravya
Copy link
Owner

Dhravya commented Apr 16, 2024

This could definitely work, JWT shouldn't be needed if the cookie is stored already (user is authenticated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants