Commit d7b7bd18 authored by Stefy Spora's avatar Stefy Spora

Add contextual menu items for direct privacy settings on video/picture pages

- Add two new context menu items that appear only on video/picture pages:
  - 👥 Set to Friends Only - sets privacy to friends_only
  - 🌐 Set to All Fetlifers - sets privacy to all_fetlifers
- Context menu items only appear on FetLife video and picture URLs
- Support both direct URLs (/videos/ID, /pictures/ID) and username URLs (/{username}/videos/ID)
- Update context menu click handlers to process privacy settings directly
- Add notifications for successful privacy changes
- Update README.md with new Method 5 for direct privacy setting via context menu
- Update CHANGELOG.md to document the new context menu functionality
- Maintain consistent user experience with popup-based privacy controls
parent 0cd0e345
...@@ -11,12 +11,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -11,12 +11,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Privacy Level Selection**: Added dropdown menu to choose between "Friends Only" and "All Fetlifers" privacy settings - **Privacy Level Selection**: Added dropdown menu to choose between "Friends Only" and "All Fetlifers" privacy settings
- **Dynamic Privacy Settings**: Extension now respects user-selected privacy level for both pictures and videos - **Dynamic Privacy Settings**: Extension now respects user-selected privacy level for both pictures and videos
- **Flexible Privacy Control**: Users can set media to friends-only or make it visible to all FetLife users - **Flexible Privacy Control**: Users can set media to friends-only or make it visible to all FetLife users
- **Context Menu Privacy Options**: Added right-click options on video/picture pages:
- 👥 Set to Friends Only
- 🌐 Set to All Fetlifers
### Enhanced ### Enhanced
- **User Interface**: Added privacy level selector above the action buttons - **User Interface**: Added privacy level selector above the action buttons
- **Privacy Options**: Pictures can be set to "only_friends" or "public" - **Privacy Options**: Pictures can be set to "only_friends" or "public"
- **Video Privacy**: Videos can be set to friends-only (true) or all users (false) - **Video Privacy**: Videos can be set to friends-only (true) or all users (false)
- **Bulk Processing**: Privacy level selection applies to all bulk operations - **Bulk Processing**: Privacy level selection applies to all bulk operations
- **Context Menu**: Enhanced with direct privacy setting options on media pages
## [1.0.2] - 2025-08-31 ## [1.0.2] - 2025-08-31
......
...@@ -58,6 +58,14 @@ A Chrome browser extension that automates privacy settings on FetLife.com. When ...@@ -58,6 +58,14 @@ A Chrome browser extension that automates privacy settings on FetLife.com. When
3. Select "Run on All Media" from the context menu 3. Select "Run on All Media" from the context menu
4. Notifications will show progress and completion status 4. Notifications will show progress and completion status
### Method 5: Context Menu (Direct Privacy Setting)
1. Navigate to a specific FetLife video or picture page
2. Right-click anywhere on the page
3. Choose from the privacy options:
- **👥 Set to Friends Only** - Sets privacy to friends-only
- **🌐 Set to All Fetlifers** - Makes content visible to all FetLife users
4. A notification will confirm the privacy setting change
## Donations ## Donations
The extension includes multiple donation options to support its development: The extension includes multiple donation options to support its development:
......
...@@ -35,6 +35,31 @@ chrome.runtime.onInstalled.addListener(() => { ...@@ -35,6 +35,31 @@ chrome.runtime.onInstalled.addListener(() => {
documentUrlPatterns: ['https://fetlife.com/*'] documentUrlPatterns: ['https://fetlife.com/*']
}); });
// Create privacy-specific context menu items for video/picture pages
chrome.contextMenus.create({
id: 'set-friends-only',
title: '👥 Set to Friends Only',
contexts: ['page'],
documentUrlPatterns: [
'https://fetlife.com/videos/*',
'https://fetlife.com/pictures/*',
'https://fetlife.com/*/videos/*',
'https://fetlife.com/*/pictures/*'
]
});
chrome.contextMenus.create({
id: 'set-all-fetlifers',
title: '🌐 Set to All Fetlifers',
contexts: ['page'],
documentUrlPatterns: [
'https://fetlife.com/videos/*',
'https://fetlife.com/pictures/*',
'https://fetlife.com/*/videos/*',
'https://fetlife.com/*/pictures/*'
]
});
console.log('FetLife Privacy Helper extension installed'); console.log('FetLife Privacy Helper extension installed');
}); });
...@@ -93,6 +118,62 @@ chrome.contextMenus.onClicked.addListener(async (info, tab) => { ...@@ -93,6 +118,62 @@ chrome.contextMenus.onClicked.addListener(async (info, tab) => {
message: 'Bulk processing error: ' + error.message message: 'Bulk processing error: ' + error.message
}); });
} }
} else if (info.menuItemId === 'set-friends-only') {
try {
// Execute privacy update with friends_only setting
const results = await chrome.scripting.executeScript({
target: { tabId: tab.id },
function: (privacyLevel) => executePrivacyUpdateFromContext(privacyLevel),
args: ['friends_only']
});
const result = results[0].result;
// Show notification with result
chrome.notifications.create({
type: 'basic',
iconUrl: 'icon48.png',
title: 'FetLife Privacy Helper',
message: result.success ? 'Set to Friends Only successfully!' : 'Error: ' + result.message
});
} catch (error) {
console.error('Context menu friends-only execution error:', error);
chrome.notifications.create({
type: 'basic',
iconUrl: 'icon48.png',
title: 'FetLife Privacy Helper',
message: 'Error: ' + error.message
});
}
} else if (info.menuItemId === 'set-all-fetlifers') {
try {
// Execute privacy update with all_fetlifers setting
const results = await chrome.scripting.executeScript({
target: { tabId: tab.id },
function: (privacyLevel) => executePrivacyUpdateFromContext(privacyLevel),
args: ['all_fetlifers']
});
const result = results[0].result;
// Show notification with result
chrome.notifications.create({
type: 'basic',
iconUrl: 'icon48.png',
title: 'FetLife Privacy Helper',
message: result.success ? 'Set to All Fetlifers successfully!' : 'Error: ' + result.message
});
} catch (error) {
console.error('Context menu all-fetlifers execution error:', error);
chrome.notifications.create({
type: 'basic',
iconUrl: 'icon48.png',
title: 'FetLife Privacy Helper',
message: 'Error: ' + error.message
});
}
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment