Closed Bug 844620 Opened 12 years ago Closed 12 years ago

WebConsole doesn't allow to modify variable in a page

Categories

(DevTools :: Console, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 690529

People

(Reporter: laurent, Unassigned)

References

()

Details

Attachments

(1 file)

(deleted), text/html
Details
In the web console, we can retrieve values of variable created in the content document. We can even modify them. But it doesn't really modify the variable IN the content document. It seems it modify only a copy of this variable.

Steps to reproduce:

1. open the URL. it is a page where a foo variable is set with the value "ok". A function show() return the value of this variable
2. open the web console
3. type:  foo
4. the console show "ok"
5. type: show()
4. the console show "ok"
6. type: foo="bar"
7. the console show "bar"
8. type: show()
9. the console show "ok"

Expected result: the last show() call should return "bar" instead of "ok".

It's an annoying bug when we want to debug a webpage...
Attached file testcase (deleted) —
I can reproduce on data-uri's, but this testcase works fine for me.

Data-uris has extra restrictions on them now days, your sure that's not what your seeing?
Laurent: thanks for the bug report.

This is a duplicate of bug 690529, which will be fixed by bug 783499.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Work around: you can do |window.foo = 'bar'| and it will work as intended.
Thanks Mihai. I discovered the workaround later after submitting the bug. Although it works, it is not intuitive IMHO :-)

Cork: No, the issue is also with real document. And I have also the same issue within a project I'm working on, that uses a sandbox in the same way as the Web Console.
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: