Closed jspenguin2017 closed 5 years ago
You've probably already seen it, but in case you haven't, check out uBlock-Edge. Although it hasn't been updated since July, nikrolls (the maintainer) did find some workarounds for Edge's incompatibility issues, which you might be able to integrate into Nano for Edge.
I know that repo, and I plan on looking at it, I just added a 2 lines shim to see how well it performs.
Update: I quickly looked over his code and I don't really like how he did it. I probably will go read the doc and put together a shim from scratch, we'll see how it goes.
[Update by jspenguin2017: Folding this post as it is long and already resolved]
Amazing! Can you post your changes? Like a patch file or a repo commits?
The file list different from platform\chromium are
manifest.json
vapi-common.js
vapi-background.js
vapi-client.js
vapi-webrequest.js
cloud-ui.js
cloud-ui.js need change becouse Edge syncs data in the background, so this callback is very fast. It's often faster than initialisation, meaning there's a race condition where the UI is not always ready for the assumptions this function makes. This change is what I found from uBlock-Edge.
OK, cool, as Microsoft Store is still full according to Microsoft, we might have to wait a while, I'll start with new Dashboard.
Microsoft is slowly but surely adding more extensions to their store. It couldn't hurt to submit Nano AdBlocker and/or Nano Defender for review just to get in the queue. They've added 10 more extensions and are now up to 80 total, which at least shows that they're moving forward with it. I understand if you wanted to add more polish/features/etc. first.
If I submit it now, can I update it when it's in the review queue?
@kevin12314 Can you copy-paste your custom filters? Something doesn't feel right about the syntax highlighter.
@@/showads.js$domain=shink.in
avlang2.info##div.tac
ck101.com##div.fuckBlockCover>div.playerCover
cool18.com##div.body_center[style='width:1000px;height:270px;']
@@||fas.li^$generichide
!@@||btrll.com^$third-party
@@|http://$subdocument,domain=iqiyi.com
!UDN購物
@@shopping.udn.com/mall/images/spacer.gif?
!ASUS
@@||googletagmanager.com/gtm.js?$third-party,domain=asus.com
! Windows Central Youtube Block Workaround
@@|blob:$domain=windowscentral.com
! 2017年2月9日 下午 11:39:12 http://www.hclips.com/videos/18-year-old-japanese-teen-recorded-fucking-her-boyfriend/?promo=1102
www.hclips.com##.pl_1
! 2017年3月29日 下午 10:07:55 https://gnn.gamer.com.tw/0/145260.html
gamer.com.tw###BH-bigbanner
! 2017年4月18日 下午 11:44:51 https://9song.me/2017/04/17/%e7%be%8e%e9%ba%97%e6%9c%aa%e4%ba%a1%e4%ba%ba/
9song.me##a[href^="http://gdot.h978.com/index.phtml"]
! 2017年4月18日 下午 11:45:27 https://9song.me/2017/04/17/%e7%be%8e%e9%ba%97%e6%9c%aa%e4%ba%a1%e4%ba%ba/
9song.me##.entry-inner > .post
! 2017年5月21日 下午 10:05:15 https://www.google.com.tw/search?q=%E5%B7%B4%E5%93%88%E5%A7%86%E7%89%B9&ie=&oe=
google.*##.pdp-psy
! 2017年5月21日 下午 10:36:44 https://www.google.com.tw/maps/@25.005939,121.4565846,13z
www.google.com.tw###pushdown
! 2017年5月21日 下午 10:41:01 https://docs.google.com/document/u/0/
docs.google.com##.gb_g.gb_Mc.gb_Kc.gb_Lc
Unicode 8206...?? http://www.fileformat.info/info/unicode/char/200e/index.htm
Those filters were generated through uBlock Origin Block element. If I key in filter like ! 2017年5月20日 下午10:41:01 https://docs.google.com/document/u/0/ It seems that it did not add Unicode 8206.
Yea, the guy who did the translation had some weird stuff going on with his IDE. Actually, it's a quirk in Edge.
If I submit it now, can I update it when it's in the review queue?
Yes, you can submit as many times as you like and your most recent submission will be the one considered.
@jspenguin2017 I update build scripts use Node.js and remove same files in platform\edge files as in platform\chromium. All update is base on v1.0.0.24 Source code.
File: NanoCore.zip Edge extension: Nano_Edge.zip
You are on the beta version of Windows? The latest stable version of Edge is 40.15063.674.0
.
I don't see what your patch to cloud-ui.js
achieve, it waits for the button? Why?
browserAction.setIcon
in Edge mutates objects that are passed in, WTF?
It's more complex than I expected, hum... Still crashing...
I put up an official build for Edge: https://github.com/NanoAdblocker/NanoCore/releases I'm sure there are many bugs left...
document.querySelectorAll
doesn't return an iterable object? wat?
This should fix the broken element picker.
Hold on... The syntax highlighting is more broken on Edge than I expected...
Old opening:
I see the problem with cloud UI, it's not a problem with Edge, it's @gorhill 's programming error. There is no documentation saying that messaging is always slower than XHR. It's not a safe assumption on any browser, it just happens that XHR is way faster on both Chrome and Firefox. https://github.com/NanoAdblocker/NanoCore/commit/413f04105867e542bd1dfba83ddbb6b1ddf60392
The comment in nikrolls's code is misleading, it's not Edge "syncs in the background", which sounds like Edge will "write to storage.sync
in the background after telling the extension it's done", it's Edge has a faster messaging pump, in fact, it looks like the callback is sometimes synchronous (which uncovered a(nother) race condition bug in Nano Linter).
@reunicorn I reserved the name (cost me $20, but it's one-time fee unlike cough Apple cough), I have Appx package built although Microsoft won't accept it until they have reviewed the Chrome version, eh, wat?
Firefox developer account is free, Google developer account is a one-time fee of $5 for Chrome extensions and (another) $20 for Android app, Microsoft developer account is a one-time fee of $20, Apple developer account is $99 per year.
That's great news! Thank you especially for your work (and kevin12314's) in working around Edge's current shortcomings. Yes, it's bizarre how Microsoft is managing their extension ecosystem. Hopefully things will get better after Redstone 4 is released this March/April. Sorry that you've had to pay those fees. That Apple fee is astronomical! Am I correct that you don't accept donations? If not, do you have a favorite charity that I could give to as a sign of thanks?
I can't accept donation as none of the contributors of uBO accepts that. The guy doing Safari port of uBO have to pay $99 per year, and he isn't asking for donation.
It's a one-time fee and honestly I probably have to get the Microsoft developer license one day anyway. It was a good learning experience, I now know how to use clever breakpoints to get around Edge's horrible debugger.
I checked uBO-Edge repository, their shim is incomplete, cloud UI and reload fixes are hacked together, but well, whatever works... There are 2 other crashes that are not addressed, which is why Edge version of uBO is kind of wonky:
ping
as type to webRequest
throws, which cause a script to not finish executingfor ... of
loop throws with document.querySelectorAll
, which is why the element picker isn't working in uBO-EdgeOpening background console doesn't let you see previous errors, you need to run location.reload()
to get them. Clicking the reload extension button closes the debugger...
I can PR but I'm not sure when nikrolls will be back... If he's back then it's like 10 lines of code to copy and he probably doesn't need a PR.
Nano will also instruct Edge to show the icon on the address bar automatically, and that was the last problem to address. Can't think of anything else that's broken for now. As always, bug reports welcomed.
Edge isn't missing too many APIs, privacy
and a better webRequest
is all we need.
Also the tab reload function is a nice-to-have.
I noticed on your "Installation on Edge" page that you have/require version 40.15063.674.0 of Edge. The latest stable version of Edge is actually 41.16299.15.0, available in the Fall Creators Update. I think it has some added APIs and features, and I know that it has better developer tools than version 40. If you haven't updated to Windows 10 Fall Creators Update (1709) it might not be a bad idea :)
Eh what? Both of my Windows devices are still on 15063... Am I missing something?
Yes, you're missing the latest update. You can go here to Microsoft's download page and click Update Now to install version 16299.
Oh, interesting, since the Edge version won't hit Microsoft Store for a while, I might try it out. It would eventually be pushed through regular Windows Update, right?
Microsoft push "Featuer Update" to Windows Update is always slowly, but yes, it would eventually be pushed through regular Windows Update.
Yes, that's right, eventually it would be pushed to your system. They always do a staggered release of new major Windows versions. 16299 has been out for just over 3 months now.
Here are the new developer features in Edge 41 (they especially focused on DevTools improvements), and Here are all the new Edge user features.
My wishlist:
webRequest
that supports more typesprivacy
filterResponseData
(Also on Chrome)@jspenguin2017 When I clicked on Nano defender icon in Edge, it did nothing. I checked F12 and it showed SCRIPT5007: Object expected
. In 1-background-core.js
row 112. Edge still not support runtime.openOptionsPage() API. I did this change to workaround.
chrome.browserAction.onClicked.addListener(() => {
if(a.isEdge){
var optionsUrl = chrome.extension.getURL("options.html");
chrome.tabs.create({ url: optionsUrl })
}
else{
chrome.runtime.openOptionsPage();
}
});
I'm aware of this and it's on my (private) to-do list. It's not a serious problem so there is no rush, I'll fix it sometime next week.
The problems with options page on Edge are now fixed.
Not sure if this appropriate or not, but thanks for this extension. I've been waiting for ages to get something this good on Edge. Even with the dev version the bandwidth savings are great. I came across it here. Sorry for posting this here. Keep up the great work.
OK, I got Edge 41, and document.querySelectorAll
is behaving properly now. The current shim for that function is extremely expensive, maybe I should drop the support for Edge 40. For some unknown reason, Microsoft doesn't disclose the proper Edge version in navigator.userAgent
.
new Date().toLocaleString("fullwide")
still throws on Edge.
Edge now supports these request types, need to test if fetch
can be (ab)used to bypass XHR filtering.
[main_frame,sub_frame,stylesheet,script,image,object,xmlhttprequest,fetch,ping,other]
In comparison, Chrome's accepted types are:
"main_frame", "sub_frame", "stylesheet", "script", "image", "font", "object", "xmlhttprequest",
"ping", "csp_report", "media", "websocket", or "other"
After a quick test, fetch
is causing problems:
fetch
as wellfetch
fetch
as that is not a recognized typeI believe that what was done under the old nsIContentPolicy in Firefox was using xmlhttprequest
filters to match both xmlhttprequest
and fetch
; there was an internal list of filter types that he request types were mapped to, and it was modified as the set of request types changed (in particular, including Web fonts and HTML5 media).
The current system isn't scalable, I'll patch Edge's API instead, and make them work nicely with a Chrome extension. https://github.com/jspenguin2017/Edgyfy
I rolled out a hotfix for Edge: https://github.com/NanoAdblocker/NanoCore/commit/de3425c6cb5643542a45a1441fe44b1911d34043 Hopefully I didn't blow other things up...
A small update on my test devices, my Surface Pro 4 is having some problems, it blue screens every 10 minutes when I'm at home and once or twice when I'm at school. I tried everything and it looks like I have to try Ubuntu to see if it works better as Microsoft tech support is the biggest meme in modern history. The recovery option are mostly decoy buttons, the only one that actually works is reinstall from cloud which pulls an equally broken copy of Windows.
I will still have one Windows device left, but it's running an unregistered copy of Windows which means I'll ditch it if Microsoft ever decides to force unregistered users to pay. Edge support might be dropped if I ever delete the last copy of Windows.
I guess I can always run a VM but honestly I don't want to.
Using Windows sometimes requires a completely fresh installation is already a normal one. Just remember to backup important files. There still a lot of tools make Windows registered. You can go to My Digital Life Forum to find them. I still hope you can continue to support Microsoft Edge.
@kevin12314 I tried that, Microsoft won't let me to do a fresh install. The button doesn't work. I switched to Ubuntu and it stopped crashing since then, although something is glitchy about sleep and hibernate.
Maybe you can go to https://www.microsoft.com/en-us/software-download/windows10. Download Media Creation Tool and create USB install media. Reboot computer and boot into USB install media to install windows 10. If installer need install key, just click skip button. after finish install and connect to internet, your pc will auto registered
@kevin12314 That's exactly what I did, doesn't work.
For Chromium-based Edge: https://www.microsoft.com/en-us/microsoft-edge/insider-addons/detail/epbkapkgcmdmfpogenoebpdeibmfinpf
New thread: https://github.com/NanoAdblocker/NanoCore/issues/253
Nano Adblocker is published: https://www.microsoft.com/store/productId/9NSXDX2TDB3V
Nano Defender is in review since May 2018...
Knows issues
Edge does not support listening to
web_accessible_resources
requests...Edge restores (un-maximize) when
browser.tabs.reload
orbrowser.tabs.select
is called.Opening Logger in InPrivate mode breaks cosmetic filtering.