I’m writing a WebExtensions browser plugin that will modify the DOM of the current page when the user presses a button in the toolbar. More specifically, I need to insert HTML tags into the DOM. Even more specifically, every word on the page needs to be wrapped in a span tag.
In principle there’s no way to predict how this might intefere with page scripts. For example, if a page has a script that relies on the number of span tags in the page being 25, and then my script adds 800 new ones, I’ll break the page script.
How can I get around this issue? I’ve thought of a few alternatives:
“Freeze” the page. When the user pushes a button to activate the extension, the page essentially becomes static HTML. My extension won’t allow any DOM changes from page scripts after it runs.
Clone the DOM and overlay the cloned DOM over the old page using z-levels. Insert my HTML into the clone and let page scripts act on the original copy. Monitor the original page for DOM changes and mimic them in my clone.
Screw it. The extension won’t work on pages with scripts that rely on the DOM not having the extra span elements in it. Do testing to make sure that doesn’t happen on popular websites.
Modifying the page DOM isn’t exactly obscure behavior for extension. What are the general strategies for avoiding disastrous conflicts?
✓ Extra quality
ExtraProxies brings the best proxy quality for you with our private and reliable proxies
✓ Extra anonymity
Top level of anonymity and 100% safe proxies – this is what you get with every proxy package
✓ Extra speed
1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!
USA proxy location
We offer premium quality USA private proxies – the most essential proxies you can ever want from USA
Our proxies have TOP level of anonymity + Elite quality, so you are always safe and secure with your proxies
Use your proxies as much as you want – we have no limits for data transfer and bandwidth, unlimited usage!
Superb fast proxy servers with 1,000 mb/s speed – sit back and enjoy your lightning fast private proxies!
99,9% servers uptime
Alive and working proxies all the time – we are taking care of our servers so you can use them without any problems
No usage restrictions
You have freedom to use your proxies with every software, browser or website you want without restrictions
Perfect for SEO
We are 100% friendly with all SEO tasks as well as internet marketing – feel the power with our proxies
Buy more proxies and get better price – we offer various proxy packages with great deals and discounts
We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!