Last modified: 2011-09-13 09:03:21 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T32856, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30856 - addScript in BeforeDisplayPage
addScript in BeforeDisplayPage
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
1.17.x
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-11 17:16 UTC by Wolfgang Rohrschacher
Modified: 2011-09-13 09:03 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Wolfgang Rohrschacher 2011-09-11 17:16:21 UTC
I'm using "addScript" for a own "BeforeDisplayPage" hook to add some scripts and stylesheets ($out->addScript("<link ....") and $out->addScript("<script ...")); This works fine up to 1.16.5. 

In 1.17 the "SCRIPT" and also the "LINK" are inserted at the end of HTML and not in the "<HEAD>". For CSS this is a problem (e.g. "flicker" effects for "display none" CSS elements).

Problem currently bypassed using "$out->addHeadItem" which works fine. 

May be you could change this to implicit "addHeadItem" in the future? 

Problem seems to be only in "BeforeDisplayPage" hook processing, not in PARSER extensions. From my point of view (maybe wrong) it relates to the resource loader processing (which works fine!)

Regards

W. Rohrschacher
Comment 1 Roan Kattouw 2011-09-12 20:11:25 UTC
What you should really do is migrate your extension to ResourceLoader properly, see https://secure.wikimedia.org/wikipedia/mediawiki/wiki/ResourceLoader/Migration_guide_for_extension_developers
Comment 2 Roan Kattouw 2011-09-13 09:03:21 UTC
Closing as WORKSFORME, this is not a bug. You should migrate your extension to ResourceLoader. As of 1.18, you will be able to use 'position' => 'top' in the module definition to specify that your module should be loaded in the <head>.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links