Open Dark3n89 opened 5 months ago
Allready working at pure extenssion... i have big problems with same seasson or localstorage load back. ..
Userscript looks good - parts of it is likely to be implemented in fb-cmf.
re issue with storage: - Are you referring to the userscript or the extension?
If userscript, FB will wipe out the "unauthorised" cookies and most storage options.
The following options would work:
fb-cmf uses the Indexed DB option to store user's settings. Relies on the idb-keyval library to manage the storage. (https://unpkg.com/browse/idb-keyval@6.0.3/README.md)
If extension, In Firefox use this: browser.storage.local.set(...) / browser.storage.local.get(...) In Chromium use this: chrome.storage.local.set(...) / chrome.storage.local.get(...)
In the extension, you might need the "permissions" option "unlimitedStorage" in the manifest.json file - this allows more than 5Mb of data to be stored.
I was talking about my code. It should remember the offending URLs and skip them much faster next time. You will notice this feature when 3-4-6 Instagram reels are skipped in a row.
Maybe it's my fault, I have a complexly secured system. Anyway, I can't keep the list of non-compliant URLs saved. The values are reset to zero very often, or in a new window.
Damn it, the main thing is already working and working damn well.
Here is the newest version: https://github.com/Dark3n89/Instagram-reel-remover but still +/- same bug.
FYI, the indexedDB data is wiped out when the browser clears the cache.
I do note that sometimes the script stops working if db
is not opened/ready.
Below is a suggestion on tweaking the code that detects IG content (you'll need to test it more):
// -- This html pattern occurs 1-2 times per reel post
const elements = Array.from(document.querySelectorAll('div > span[dir] > span > div'));
for (const node of elements) {
if (node.offsetParent !== null && node.innerText && node.innerText.includes("Instagram")) {
foundInstagramContent = true;
break;
}
};
if (foundInstagramContent === false) {
// -- Try again, but query for a sprite image that has the IG icon
// -- (do not specify the filename - fb has multiple copies with different filenames)
// -- Has to be in a certain HTML structure/pattern that is unique to the IG reel posts
foundInstagramContent = (document.querySelector('span > div > div > span > i[style*="background-image"]') !== null);
}
I am currently working on a version of a regular extension where everything works perfectly and holds the data until the user reloads the extension.
I experimented with an external database, in my new project the reels are destroyed immediately after loading the site even as suggestions.
But it will still take some time, I assume that the external database will help all people globally to get rid of ballast.
I've been working on the removal script for a long time, it's almost unreal ... Here I made a function that automatically skips INSTAGRAM REELS and remembers "infected" url addresses, for the next faster rewind. I like your project, you saved me a lot of time and I would like to return the favor :) As a bonus, you can save the list of unwanted urls for future use when you click on the icon :)
` // ==UserScript== // @name Skip Instagram Content on Facebook Reels with URL Tracking // @namespace Skip Instagram // @version 1.0 // @description Automatically skip URLs that have been previously skipped and click "Next" if Instagram content is detected on Facebook Reels. Displays total skipped reels count in a popup and allows exporting skipped URLs to a text file. // @author Projekt Darkside - Brno city Bohemia. // @match https://www.facebook.com/* // @grant none // ==/UserScript==
(function() { 'use strict';
})(); `