Closed (fixed)
Project:
Dreditor (moved)
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Sep 2009 at 21:52 UTC
Updated:
3 Jan 2014 at 00:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
deviantintegral commentedJust a note that Dreditor doesn't seem to work in Safari with GreaseKit (I'm running 64-bit Safari on 10.6). So, perhaps the issue is with webkit, and not the GreaseMonkey engine.
Comment #2
berdirActually, chrome does have built-in support for GreaseMonkey scripts now, they are automatically converted into an extension. So it would be really awesome to have dreditor working with Chrome.
See also http://dev.chromium.org/developers/design-documents/user-scripts
Comment #3
chx commentedYes. This would be awesome.
Comment #4
chx commentedthere are 3-3 DM_getValue and DM_setValue calls in dreditor. A HTML5 equivalent can be found at http://people.w3.org/mike/localstorage.html
Comment #5
flickerfly commentedsub
Comment #6
Anonymous (not verified) commentedDreditor doesn't work on Safari probably because some differences between the JavaScript engine used by Mozilla powered browsers, and the JavaScript engine used by Safari. As Chrome uses a different script engine, Dreditor should be compatible with Chrome.
Differently, there would be the need to have different versions for each of those browsers.
Comment #7
seutje commentedhow's this?
haven't been able to test as my chrome is being a lil brat
attempts to fall back to GM_setValue/GM_getValue if localStorage is not available
Comment #8
sunUnfortunately, this will break with GreaseMonkey in Firefox. That is, because Drupal.dreditor is in the scope of the "unsafe" document. GM_setValue() and GM_getValue() are only allowed to run within the scope of the user script, because they actually access/alter browser configuration values. That's why I had to implement that nasty trick using load + unload events.
So what we need to do is:
- Add helper functions, in the local scope of the user script, i.e. not Drupal*
- Make those functions dynamically use either localStorage or GM functions.
- If anyone can think of a one-time upgrade path to migrate from GM to localStorage, that would be extra awesome.
Comment #9
seutje commentedhmm, kinda figured u would of already done this if it were that easy :P
Comment #10
seutje commenteddamn it, every time!
Comment #11
seutje commentedchanged em to global functions and added a manifest.json which chrome seems to require
can't seem to debug/test this as my chrome is refusing to load any content scripts
Comment #12
chx commentedI think the manifest is only necessary for a crx , an extension.
Comment #13
sunNote that I'm unable to test this, because I don't have (a real) Chrome browser installed.
We can remove those clean-ups. That entire sortOrder code is copy/pasted from jQuery 1.3, and should be kept identical for comparison with the original. Sorry.
err, syntax error? ;)
s/:/=/
s/},/}/
Powered by Dreditor.
Comment #14
andypostAs described at http://code.google.com/chrome/extensions/content_scripts.html
So it's not possible to access Drupal object from content script
Comment #15
hanoiiInterested on this.
Comment #16
mcrittenden commented.
Comment #17
q0rban commentedsubscribe
Comment #18
bleen commentedsubscribe
Comment #19
andypostFor chrome browsers it seems possible to add 'script' into DOM and run as part of a page. This approach has nothing related with grease monkey but should work. Suppose script could be downloaded directly from d.o
page http://code.google.com/chrome/extensions/content_scripts.html a bit updated with some examples
Comment #20
cburschkasubscribe. This would be pretty awesome.
Comment #21
duellj commentedsubscribe
Comment #22
ericduran commentedSo the chrome plugin will need to be apart from the grease monkey script. In chrome you're allow to communicate with the dom but you need to do it through the messaging api provided. There's some example of this @ http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions... and also you can see a working example http://github.com/ericduran/Drupal-for-Chrome/tree/master/scripts/ . So it's going to be a bit of work :-/
Comment #23
philbar commentedSubscribe
Comment #24
sunJust wanted to leave a note that I tried to test Dreditor with Chrome yesterday (using the
--enable-user-scriptsswitch for the executable), but I have no idea how developers are able to code extensions for Chrome, since the browser only refreshes/reloads the user script/extension when restarting the browser... (WTF?) Obviously, it takes ages to fix the script that way. :( Does anyone have any pointer/idea for how this can be changed? (I already searched the net, but only found similar complaints about this behavior, without working resolutions.)Comment #25
bleen commentedI've never devloped for chrome, but I'd really like dreditor support for chrome so I thought I'd look around a bit... I think this is the answer:
http://code.google.com/chrome/extensions/getstarted.html
UPDATE: yes, I just gave this a quick try and it works as advertised. Hope this helps
Comment #26
ericduran commentedHey,
So I've dabble in chrome a bit. Ha, only to do drupal related stuff. I started a project the other day http://github.com/ericduran/chrome_dreditor which is an attempt to port dreditor to chrome. I did the easy stuff 1st, which is pretty much all the top menu stuff by only adding the css file. Now the patch review feature is missing.
As @sun mention this is not an easy task. This pretty much required an entire rewrite of Dreditor because chrome scripts run on a different environment then the site scripts. The only thing you have access to is the dom. That being said you can insert what ever you want into the dom, so is not impossible.
@bleen, popup, would work but it'll be a lot harder because the popup doesn't have access to the dom, It's a lot easier to insert a script into the page than using chrome message passing system to access the dom in the popups. So essentially Dreditor can work just like it does in firefox, with a rewrite that is :-(.
I'll probably keep working on the port I started if anyone is interested. I'll see if I can start porting over the file review stuff later.
Comment #27
bleen commentedericduran: I was only suggesting to sun that when developing he just needs to go to the extensions page and hit reload because he seemed to be getting annoyed at restarting the whole browser
Comment #28
sun@ericduran: While I totally appreciate that you want to help to solve this issue, the work that has been started in http://github.com/ericduran/chrome_dreditor cannot be diffed at all, so it will very quickly lose track of changes and fixes applied to Dreditor. Apparently, it seems like you blatantly emptied the entire .js file. I don't think it's the right solution attempt. Dreditor is a pretty complex script that requires steady and prompt maintenance, especially when drupal.org happens to be changed and updated. Thus, if you want to help to move this issue along, we need to look into making Dreditor itself compatible. That may mean that we have to add further files to build a full Chrome extension, and Chrome users may need a different way to download and install the "module" (extension), but that's the challenge we have to figure out here.
Comment #29
ericduran commented@bleen, cool sorry misunderstanding.
@sun, ok understandable. I did take the whole start from scratch approach instead of trying to make the current Dreditor work in Chrome because I felt that'll it'll be easier to maintain two different versions rather trying to have one that works across both. I can see how that might not be what we want. :-/
Comment #30
ericduran commentedHey,
So I just spend a couple of minutes on this and it hit me. In order to get around chromes limitation of accessing the scripts on the page just have the scripts packaged up with the extension. After this I just had to make minor modification to Dreditor and I got it working.
Now I'm not saying is the best implementation and I know I have some hard coded values set in it. As is just merely a proof of concept. That being said, I still think the chrome extension should live on it's own.
I've attached the entire chrome extension already package if anyone wants to test it out (You'll need to rename it from .txt to .crx sorry :-( ). Once it's install you can start testing it by going to drupal.org, you can come to this issue to review the patches previously attached.
The entire extension still lives in the github repo http://github.com/ericduran/chrome_dreditor . So after Is cleaned up I'm not sure what the next step should be.
I'll wait to here from sun as what we should do.
Comment #31
chx commentedThe Chrome extension works for me on google-chrome-unstable 7.0.503.1-r57041 on Linux. Please nuke the drupal.org CSS overrides.
Comment #32
ericduran commentedSo here's an updated version with out the unleashed theme packed in there.
Note: You'll need to rename it from .txt to .crx
Comment #33
bleen commentedso far, testing in Chrome 6.0.472.55 has not worked ... makes a bleen sad
Comment #34
ericduran commentedI'm on Chrome 7.0.503.0 dev, So I'll be rolling back to 6.x and testing it there.
All feedbacks welcome.
Comment #35
sunThis issue now depends on #910636: Use HTML5 features instead of GreaseMonkey
Comment #36
ericduran commentedHi sun, I'm 100% behind making dreditor use html5 features. But it still won't solve all the issues required to run dreditor on chrome. The big one being chrome's execution of content script in an isolated environment.
Also we finally got a working port. I know, is not a perfect solution but we can make it better now as we go implementing the html5 features. Just a thought.
I didn't change the status of this issue, as is your project and I respect what ever decision you decide to go with. But I have no problem helping out with the chrome extension as I'm aware it'll required a lil more maintenance because of the extra amount of work needed to keep it up to date.
Comment #37
sunAs mentioned over in that issue: there's a 100% compatible solution that does not require any rewrite or forking.
Comment #38
seanrWow, almost a year to the day, I've got dreditor in Chrome! You all just made my day. ;-) I'll definitely be looking forward to the HTML5 version, though.
Comment #39
anarcat commentedThis doesn't work for me on 6.0.472.53 on ubuntu: I don't get any buttons around patches.
I still think this should get in, even if it's only a temporary solution while waiting for HTML5 (!).
Comment #40
ericduran commented@anarcat, I stooped working on it because it wasn't going to get in. I also deleted the github repo but maybe I'll just fix it up for Chrome 6 and 7 and keep it on github for the time being.
Comment #41
ericduran commented@anarcat, Here you go. http://github.com/ericduran/chrome_dreditor/downloads that's a working version for Chrome 6.x and 7.x.
Comment #42
bleen commented#41: Doesnt seem to work in 6.0.472 (Mac) :(
Comment #43
pbuyle commented#41 works on Chromium 7.0.528.0 (59761) Ubuntu 10.04
Comment #44
hanoii#41 working on 7.0.517.13 dev (debian testing)
Comment #45
dave reidWorks great on Chrome 6.0.472.63 on Mac OS X 10.6.4, although the patch reviewer sometimes gets funky/greedy about what code lines I'm commenting on.
Comment #46
duellj commentedAnybody willing to update this to be compatible with the d.o redesign?
Comment #47
ericduran commented@duellj, This still works with the redesign.
Also I think to be fair to @sun issues regarding the chrome fork should probably be posted somewhere else. Until there's an official chrome dreditor out.
Comment #48
hanoii@ericduran, there seems to be one thing that's not working which is the Create commit message.
And, just as an opinion, I think that in the meantime, this issue works as a nice alternative for chrome users.
Comment #49
ericduran commented@hanoii, I'll fixed the status msg, Cool I was just trying to be fare to sun.
Comment #50
andypostCurrent version works - 8.0.552.5dev win
Comment #51
duellj commented@ericduran, sorry, I should have been more specific. Indeed, the only thing broken is the Create Commit Message, though also the buttons in the patch review overlay are white on white.
This is a great option for chrome users until an official chrome dreditor is out; I really appreciate all of your work!
Comment #52
nightowl77 commentedsubscribe
Comment #53
ericduran commentedHey,
So I updated the chrome_dreditor port. It now works with blue cheese. You can download the latest version over at github https://github.com/ericduran/chrome_dreditor just be sure to download the "chrome_dreditor_1.1.crx" version.
Comment #54
jacine@ericduran Sweet, thank you! :)
Comment #55
ericduran commented@jacine, no problem.
FYI: for everyone using this, there's currently a bug that doesn't allow you to use the cancel button :-p lol, The cancel button will be interpreted as a save button. This is because dreditor currently uses javascript property "explicitOriginalTarget" which only exist in firefox. When I find a viable replacement for this in chrome I'll fix it. But for now there is non. Sorry :-/ Everything else should work as expected.
Anyways hope this is helpful to some.
Comment #56
andypostWorks fine with latest 9.0.570.1 dev under win7
Needs more reviews for different OSes
suppose we need another branch or project like chrome_dreditor
Comment #57
bleen commentedandypost: I believe that sun is working on an HTML5 based version of Dreditor that will work on Chrome & FF. This would certainly be prefereable as we would only need to maintain the code in one place. The work that ericduran has done on this issue should really be looked at as a (fantastic) stop gap so chrome users can have their fill of dreditor while waiting for sun to roll out a new version.
Comment #58
ericduran commentedeverything bleen18 said :)
Comment #59
bfroehle commented~
Comment #60
hanoiiNoticed another small bug.
This is what I did to show this bug, it may happen in some slightly different use case:
- review patch
- hightlight something
- save content
- click hide button to view the issue queue
- click show button to view the review page again
- click on paste (this now fails does nothing and if you click on cancel later, you don't see the textarea to reply any more).
I guess the bug is around the hide/show functionality.
Comment #61
sunPosted from Chrome.
Comment #62
hanoiiI tried this one. First comments:
- autocopmlete doesn't work. The yellow tooltip appear but the TAB does nothing.
- Once in review, and highlighting some text, whether I click save or cancel, it comes back to the issue.
EDIT:
Btw, using latest dev chrome, so I might not be the best tester.
Currently I have 9.0.597.19 dev but I am sure it upgraded today to the 10.x series, probably upon next restart of chrome.
Comment #63
sunThis one makes the patch reviewer work in Chrome for me.
The patch reviewer is the most important goal right now. We'll care for autocompletion and other features in follow-up patches.
Comment #64
hanoiiOk, seems to be working quite good, nice to test this on my working Saturday.
Three things (one might be not review-related but close):
1. I am not sure if this was working the same in previous versions but, when you select text on the review to add notes to it. If you select more than one line and you don't take care of selecting the newline (dragging the selection to the beginning of the next line), the last line is not included in the selection
2. If you select only one line, completely, from beginning to end, you end up with a selection of the whole document.
3. The "Create commit message" doesn't work once you preview a commit message and want to create the commit message there, I mean, once you get to: http://drupal.org/comment/reply/577412
EDIT:
2. above does not select the whole document, but rather from one line above to the line selected to the end of the document)
Seems to be working the same on 10.0.612.1 dev
Comment #65
andypostPatch review works without this patch after #910636: Use HTML5 features instead of GreaseMonkey
Commit message regeneration works - 10.0.612.1 dev linux
Comment #66
sun@hanoii: I can reproduce all three issues you mentioned in #64 in Firefox, too, so those need separate/dedicated bug reports.
I'm actively working in Firefox with this patch applied since yesterday and didn't experience any new bugs yet. With some positive confirmations of Chrome users, I'd go ahead and commit it, so we can move on to make other features compatible with Chrome.
EDIT: Also, some user in IRC pointed me to a JavaScript snippet that claims to be able to determine the clicked button in a form-level onSubmit event handler, which unfortunately came 3 hours too late, after I rewrote the form handling to submit handlers to buttons instead of forms.
Comment #67
Freso commentedSubscribing...
Comment #68
andypostWindows chrome 10.0.612.3 dev - wont work when authenticated at d.o, anonymously works fine
Comment #69
hanoiiJust created the issues mentioned on #63 in #1011080: Odd line selection behaviors on patch review for certain use cases and #1011084: Create commit message doesn't work on comment reply page.
Is this issue fixed, are all the latest patches applied?
Comment #70
hanoiihmm, just installed the version from the project's page and it's not working on chrome now. It's used to work though. Is there something going on?
Comment #71
hass commented+
Comment #72
geerlingguy commentedSubscribe.
@ericduran / #53 - plugin from GitHub (https://github.com/ericduran/chrome_dreditor) works great! Finally, I can start using the power of dreditor :)
[Edit: @ericduran - the patch by sun wasn't working for me last week. I'll have to try it again.]
Comment #73
ericduran commented@geerlingguy, sun created a patch in #63 that gives you native dreditor support without my extension.
Comment #74
ericduran commented@sun, I tested the patch in #63 and it works great :)
Tested:
- Review button shows up on patch files.
- The patch reviewer show up when clicking the "review" button.
- When reviewing a snippet of code the "save" and "cancel" button works as they're supposed too
- When returning to an already review code snipper you get the delete option and the delete button works.
- The Jump menu works as expected
- Deletion toggle works as expected
- The Paste, Hide, and Cancel button works as they're expected.
edit:
- Also the show/hide irrelevant issues works on the issues page and on the "Your Issues" block on the dashboard
- Create commit message also works.
Nice!!
I'm in Chrome 10.0.612.3 dev on the mac.
edit: I'll see if I can do more testing on other chrome versions
Comment #75
jacineHow are you guys applying this patch?
Comment #76
ericduran commented@jacine I check out head from csv, then the patch applies cleanly.
After that you just need to open the dreditor.user.js file with whatever browser you want to test it on.
In chrome it'll prompt you to download the js file you can just hit continue and then it'll recognize it as a user script and ask you if you want to install it.
Not sure if you had a specific problem with it.
Comment #77
jacineOhhh! Thank you @ericduran! I installed it first, and then tried to apply the patch. No wonder it wasn't working. :D
Comment #78
hanoiiWhat's holding this patch to be committed, more tests?
Comment #79
ericduran commented@hanoii I would say a test on a stable version of chrome.
Comment #80
jacineI've got it running in Chrome 8.0.55.231, and haven't noticed any problems so far. ;)
Comment #81
geerlingguy commentedJust as a note: I've tried applying patch in #63 to HEAD and using that with GreaseKit for Safari, but I'm not seeing any difference. It seems like it should be working :-/
Not that this issue is about Safari support... but it would be nice to be able to use it in Safari, Chrome, FireFox, Opera, etc... maybe even IE (gasp) someday!
Comment #82
bfroehle commentedI've been using the patch for a while on Chrome 9.0.597.45 beta for Mac -- haven't noticed any bugs yet. Does it still work in Firefox with the patch applied?
Comment #83
wizonesolutionsGoing to try this out and will post back how it works. If it needs more testing shouldn't it be needs review? So if it's RTBC, I echo: what's holding up it being committed?
Comment #84
sunWe need to re-evaluate this patch based on latest findings over in #1036708: Security Manager vetoed action (Firefox 3.6.13, GreaseMonkey 0.9.0)
Comment #85
hanoiiWhat's the current status of this? I am not sure I followed #84, but, what can I do to help review this?
Comment #86
andypost@sun What technique been chosen? Content Scope Runner?
There's only 5 at http://wiki.greasespot.net/Category:Coding_Tips:Interacting_With_The_Page
Comment #87
hass commentedThe "Review" button works great and all stuff inside the review, too (save, cancel, update, paste). The only thing that is not yet working is "Create commit message". The button is shown, but nothing happens if clicked. Over all this is 1000 times better than today as the most important feature (review) works great.
For all who have no idea how to patch and get this running:
1. Copy the attached dreditor.user.js to
C:\2. Open a tab, enter
file://c:/dreditor.user.js3. Follow the install process...
Comment #88
hass commentedd.o have eaten the attachment... rename the attached file to
dreditor.user.js.Comment #89
hass commentedComment #90
aspilicious commentedWorks great
Comment #91
wojtha commentedBrilliant! Works for me on Google Chrome 10.0.648.204 (Win 7 64bit)
Comment #92
sunCommitted the changes of #63 that remove proprietary FF/GM code.
Attached patch is a straight re-roll of what remains from #63. Hope to be able to investigate the alternative now.
Comment #93
sunThanks for reporting, reviewing, and testing! Committed attached patch to master.
Enforces some drastic changes:
Have fun.
PS: Some other features (e.g., commit message) do not work in Chrome yet. We need follow-up issues for these.
Comment #94
geerlingguy commentedSo, would we need to remove the 'Dependencies' section from the main project page once this is in a stable release?
Comment #95
sun@geerlingguy:
is still (almost) correct. Dreditor still needs to be installed as a user script somehow. It merely doesn't use all of the possible but browser-specific features of the user script environment anymore.
Comment #96
andypostHm, commit message still does not work. Visible but none-clickable
EDIT It works after I click at the thin bottom border of the element. After click whole link is clickable
Comment #97
anarcat commentedFWIW, this doesn't work in Chrome 6.0.472.63 (59945) Built on Debian 6.0, running on Debian 6.0.1
Comment #98
aspilicious commentedPLEASE update your chrome, they are at version 10 now... If you can't install it through the website, you can download the patch, save it as a js file and open the path in chromes.