Skip to content

Commit

Permalink
Add legacy mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kepano committed Sep 25, 2024
1 parent fc366a0 commit e637f93
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-clipper",
"version": "0.7.0",
"version": "0.7.1",
"description": "Official web clipper for Obsidian.",
"scripts": {
"dev:chrome": "webpack --watch --env BROWSER=chrome",
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.chrome.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Obsidian Web Clipper",
"homepage_url": "https://obsidian.md/",
"version": "0.7.0",
"version": "0.7.1",
"description": "Save content from the web in a private and durable format that you can access offline. The official browser extension for Obsidian.",
"permissions": [
"activeTab",
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Obsidian Web Clipper",
"homepage_url": "https://obsidian.md/",
"version": "0.7.0",
"version": "0.7.1",
"description": "Save content from the web in a private and durable format that you can access offline. The official browser extension for Obsidian.",
"permissions": [
"activeTab",
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.safari.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Obsidian Web Clipper",
"homepage_url": "https://obsidian.md/",
"version": "0.7.0",
"version": "0.7.1",
"description": "Save content from the web in a private and durable format that you can access offline. The official browser extension for Obsidian.",
"permissions": [
"activeTab",
Expand Down
13 changes: 13 additions & 0 deletions src/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ <h3>Advanced</h3>
<button type="button" id="reset-default-template-btn" class="mod-warning">Reset</button>
</div>
</div>
<div class="setting-item mod-horizontal">
<div class="setting-item-info">
<label for="legacy-mode-toggle">Legacy mode</label>
<div class="setting-item-description">
Use the URI rather than clipboard to copy content into Obsidian. Useful if you are using Obsidian 1.7.1 or earlier. The length of the content is limited depending on the operating system and browser.
</div>
</div>
<div class="setting-item-control">
<div class="checkbox-container">
<input type="checkbox" id="legacy-mode-toggle" />
</div>
</div>
</div>
</div>
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/obsidian-note-creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export async function saveToObsidian(
// Use clipboard
navigator.clipboard.writeText(fileContent).then(() => {
obsidianUrl += `&clipboard`;
obsidianUrl += `&content=${encodeURIComponent("Web Clipper requires Obsidian 1.7.2 or above. You may need to install the [early access](https://help.obsidian.md/Obsidian/Early+access+versions) version.")}`;
obsidianUrl += `&content=${encodeURIComponent("Web Clipper requires Obsidian 1.7.2 or above. You may need to install the [early access](https://help.obsidian.md/Obsidian/Early+access+versions) version, or enable legacy mode in Web Clipper settings.")}`;
openObsidianUrl(obsidianUrl);
}).catch(err => {
console.error('Failed to copy content to clipboard:', err);
Expand Down

0 comments on commit e637f93

Please sign in to comment.