• Categories
  • Recent
  • Popular
  • Users
  • Search
  • FingerprintSwitcher
  • CustomServers
  • AutomationPlugins
Skins
  • Light
  • Default
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Quartz
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Slate
  • Solar
  • Superhero
  • Vapor
Collapse

Bablosoft

How to Disable Image?

Scheduled Pinned Locked Moved Support
9 Posts 4 Posters 1288 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rcd
    wrote on last edited by rcd
    #1

    I'm new to BAS. I want to block all resource consuming factors such as images etc.

    It is explained in the forum that it can be done with request mask deny in the Network, but there is no request mask deny setting in the latest version I use.

    I thought of it myself and blocked images and the like by writing a code in the Execute On Every Page Load in Browser section. However, the images are loaded at the first opening of the pages and then blocked. How do I ensure that images and videos never load or open?

    The Code I wrote:

    var observer = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
            mutation.addedNodes.forEach(function(node) {
                if (node.nodeType === 1) {
                    cleanNode(node);
                }
            });
        });
    });
    
    function cleanNode(root) {
        const selectors = [
            'img',
            'video',
            'audio',
            'source',
            'iframe',
            'embed',
            'object',
            'canvas',
            'svg',
            'picture',
            'style',
            'link[rel="stylesheet"]',
            'script',
            '[class*="ad"]',
            '[id*="ad"]',
            '[class*="banner"]',
            '[id*="banner"]',
            '[class*="sponsor"]',
            '[id*="sponsor"]'
        ];
    
        selectors.forEach(selector => {
            const elements = root.querySelectorAll(selector);
            elements.forEach(el => el.remove());
        });
    }
    
    // Sayfa ilk yüklendiğinde temizle
    document.addEventListener('DOMContentLoaded', function() {
        cleanNode(document);
    
        observer.observe(document.body, {
            childList: true,
            subtree: true
        });
    });
    
    
    C 1 Reply Last reply
    0
  • C Offline
    C Offline
    clarabellerising
    replied to rcd on last edited by
    #2

    @rcd only deny request with mask as *.jpg, *.png and so on, code that you wrote just clears img's in html page, but not prevent to load it first

    1 Reply Last reply
    0
  • C Offline
    C Offline
    clarabellerising
    wrote on last edited by clarabellerising
    #3

    test_jpg.xml
    test script in 28.7.0

    1 Reply Last reply
    🤔
    0
  • R Offline
    R Offline
    rcd
    wrote on last edited by rcd
    #4

    @clarabellerising said in How to Disable Image?:

    test_jpg.xml
    test script in 28.7.0

    First of all, thank you for your help. Even though I did as in the example you gave, the images are still displayed in Google search. What am I missing?

    a25979d5-38e1-4935-b2dc-b5b2494c7861-image.png

    R 1 Reply Last reply
    0
  • R Offline
    R Offline
    radb0310
    replied to rcd on last edited by
    #5

    @rcd Google render image on server and response in HTML, can not deny request
    2424bdee-ef65-4088-a8ea-bc8e70a65c1c-image.png

    C R 2 Replies Last reply
    0
  • C Offline
    C Offline
    clarabellerising
    replied to radb0310 on last edited by
    #6

    @radb0310 check initiator and you'll see who make's this image

    1 Reply Last reply
    0
  • R Offline
    R Offline
    rcd
    replied to radb0310 on last edited by
    #7

    @radb0310 said in How to Disable Image?:

    @rcd Google render image on server and response in HTML, can not deny request
    2424bdee-ef65-4088-a8ea-bc8e70a65c1c-image.png

    @clarabellerising said in How to Disable Image?:

    @radb0310 check initiator and you'll see who make's this image

    Thank you for your response. Can you explain in more detail? I still don't know what to do.

    C 1 Reply Last reply
    0
  • R Offline
    R Offline
    Rashmar
    wrote on last edited by
    #8

    Disabling image download won't be ideal for detection.

    1 Reply Last reply
    0
  • C Offline
    C Offline
    clarabellerising
    replied to rcd on last edited by
    #9

    @rcd
    d886ab87-daa4-4e73-8764-e10a7eb203db-image.png
    54b405ee-0393-4c04-839b-924fe7398674-image.png
    and then it will open source of url that downloads this photo's

    1 Reply Last reply
    0

  • A

    working with images

    Scheduled Pinned Locked Moved Support
    0 Votes
    1 Posts
    392 Views
    No one has replied
  • N

    Http proxy is disabling UDP

    Scheduled Pinned Locked Moved Support
    0 Votes
    2 Posts
    630 Views
    No one has replied
  • P

    Telegram - How to disable link preview in channels?

    Scheduled Pinned Locked Moved Support
    0 Votes
    1 Posts
    400 Views
    No one has replied
  • E

    I'm trading on a second hand site called "Letgo". But the images of the products on the site are not visible.

    Scheduled Pinned Locked Moved Support
    0 Votes
    1 Posts
    321 Views
    No one has replied
  • V

    I can't upload my script. I'm having uploads disabled. The reason is why. I bought the license !

    Scheduled Pinned Locked Moved Support
    0 Votes
    1 Posts
    450 Views
    No one has replied
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Popular
  • Users
  • Search
  • FingerprintSwitcher
  • CustomServers
  • AutomationPlugins
  • Login

  • Don't have an account? Register

  • Login or register to search.